Let’s spawn some custom particles in minecraft fortune fabric courses with advanced topics such as entities custom structures and three armor models linked in the description below all right finances back intelligent once more and in this tutorial we’re going to be adding custom particles and we’re also Going to spawn them so for this we need to create our custom particle and for that we’re going to make a new package right here called particle and inside of that package we’re going to make two things what first of all a custom package and second of all a new class Called mod particles so this is where we’re going to register our particles but first of all what we want to do is we also want to create a custom class right here so this is going to be the citrine particle class the idea here is that this is going to extends the sprite Billboard particle so this is going to be very interesting because there’s going to be a lot of stuff in this class that’s going to look you know i mean kind of weird let’s say but overall it’s actually not that crazy and not that complicated let’s just hover over this Implement the method we see we need to implement the get type method and here we can just return actually particle type sheet and then we’re going to do the translucent one and then hover over this and create constructor matching super i’m going to choose the second one Actually because we want all of those and i actually have a different list or different names for the parameters because they’re just a little bit nicer so let’s just do this and there you go this is of course all available to you in the description below get a pause for An individual just as well and then let’s add the rest here for the constructor you can see we’re just setting everything to certain well variables right here incredibly important here otherwise it’s not going to work the max h is just the h it ticks so this is just how long this actual sprite This particle is going to exist in the world but the scale we’re just scaling it up or down and then for the velocity multiplier should be fairly stiff explanatory as well just basically doing you know multiplying the velocity and what i have also what we also need is Something called a factory so this is going to be the actual factory right here so let’s just take this over and this is going to be right here so this is going to be a class that’s actually between particle there you go so you can see if i Actually format this a little bit differently right here so we have a particle that implements the particle factory of default particle type so this is the just a normal type and then we just you know we basically just need this to create the actual article in Just a little bit and what i’ve also done is i’ve also added the fade out and a fade out effect to this particle so this is actually i mean as far as i know sort of custom it might actually be in the in the you know micro source code there Might actually be something for this as well but you know this is just custom so we just overwrite the tick method as you can see and called the fade out method and this just sets the alpha to whatever the max h is so one over max h times h Plus one so if you’re like what the frick is this it’s just a linear formula basically that uses max h and h and then you know just like makes it go from one to zero over the time that age basically decreases until it reaches max max h that’s pretty much all that There is to it i mean it’s it’s it’s actually a fairly straightforward math uh in this case so here is one of those instances where actually some mathematics is quite useful in this case and that actually is all of the citrine particle class that we need and the Funny thing is we actually don’t even need to you know like to use it any anywhere not even in the more particles class as right here what we’re going to do is we’re going to make a public static final this is a default particle type called citrine particle and this is Going to be equal to the fabric fabric article types dot simple that’s literally it that’s very interesting and then here we’re going to actually register it so public static void register articles and this is going to look like this this is just going to be a registry.register and it’s going to take The registry dot particle type there you go and then a new identifier of type tutorial mod that mod id comma citrine underscore particle or particles but both would be fine particles particle there you go and then after the first parenthesis we’re going to write put in the citrine particle Right here so there you go and that should be that now this one here of course has to be called in the tutorial mod class right here let’s just go at the very bottom mod articles dot register particles there you go and that is almost everything in the client class We still need to do something and that’s going to be exactly this and then right here what we wanted to call is the following the particle factory registry that get instance dot register and then pass in more particles dot citrine particle and then citrine particle so the class actually is class Dot factory colon colon new and this should be pretty much it now we still need to specify the particles in a json file and also add the texture for it so for this in the or your tutorial mod asset folder right click a new folder or new directory called articles very important particles Plural and then i will actually copy over the json file here it’s called citrine particle so this should have the same name of course as the name right here so that’s very important and then this is going to do for the following this is as you can see points to that a Texture called citrine now this points to a texture inside of the textures folder inside of the particle folder this one is singular i don’t know why it is it just is what it is so let’s actually copy this over as well this is just the normal citrine part you know Item model actually like the item texture that i’ve taken from here so that’s pretty much all that there is to it and this is now going to spawn now this is in game and you could in theory spawn it with a command however it is not yet you know spawning anywhere and Where i want to spawn it is basically when we find something with the dowsing rod so we’re gonna actually close all of this and go into our item package into the custom and in the dowsing rod item and i have actually prepared a method for this this is the spawn found Particle method and it’s going to look a little bit crazy here let’s actually import this as well citrine particle there you go and in theory what this should do is it should spawn the citrine particles in a circle this is why i use the cosine and the sine here but for Whatever reason it doesn’t really do it in a circle i am honestly not sure why because i have the exact same code for the forge tutorial prepared and it spawns in a circle so i don’t know what is up with that if you know anything about that then i mean please feel free To contact me because i genuinely can’t figure out why this wouldn’t work because it it’s just math so i don’t know why you know it would have any issues um you know maybe i mean maybe x and z are you know confused i i genuinely don’t Know so you know if you have any ideas please feel free to contact me you’re going to see how this spawns in just a little bit but it’s still going to look pretty cool so no worries there and we’re just going to add this right here so we’re going to say spawn found Particles passing in the context and the position clicked and that is pretty much all that we want to do here so yeah that’s actually all that there is to it i mean you can see when you have the world then you can add the particle now what’s very important is that the world Here should be the client world in theory if you and then only the client or this is called can actually see this so only the person who right click with the dowsing rod should be able to see the particles so if you have a second person standing right next To it they should not see the particles if you want to implement something like that then you’re gonna need to do some custom packets and a networking and that is not something we’re gonna do at the moment so please keep that in mind right but that is actually all of the things That we need to do so i guess let’s see if it works all right so we find ourselves in minecraft and let’s just right click and there you go so we actually see the particles spawn and you can see they’re not really spawning in a circle like i i genuinely don’t know why That is the case with actual velocity i’ve set it should in theory work but you know as you can see i don’t know if it adds you know a fabric adds like more custom stuff to it like more custom velocity like a little bit of randomness I mean because they do look random every time i do them so i genuinely don’t know but that is the case i mean it still looks pretty cool and it still works really fine and it’s it’s such a cool effect isn’t it it’s like it’s just a Little bit of extra you know added to this when you find something and if you don’t find something you can see that it’s not actually added so that’s how cool this might be and i mean yeah that’s how easy it is to add some custom particles minecraft all right but that Would already be for this tutorial right here i hope you found this useful and you’ll learn something new if you did would very much appreciate like don’t forget to subscribe for more tutorials just like this one i also want to thank all of my lovely patreon supporters for Supporting me and this channel it is very much appreciated and i’ll see you in the next tutorial so yeah Video Information
This video, titled ‘Minecraft 1.18.2 Fabric Modding | CUSTOM PARTICLES’, was uploaded by Modding by Kaupenjoe on 2022-04-29 13:59:56. It has garnered 3614 views and 67 likes. The duration of the video is 00:08:57 or 537 seconds.
In this Minecraft Modding Tutorial, we are adding custom particle types with Fabric in Minecraft 1.18.2
== MINECRAFT COURSES == ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 *
== ASSETS & DOWNLOAD LINKS == GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Fabric-Tutorial-1.18.1/tree/49-customParticles Gist: https://url.kaupenjoe.net/yt279/gist
== TIMESTAMPS == 0:00 Intro 0:25 Creating the custom Particle Class 3:21 Registering the custom Particle 4:59 JSON File Particle Texture 6:00 Spawning the Particle 7:53 Demonstration 8:37 Outro
== TAKE A LOOK AT MY COURSES WITH COUPON CODES == ▶️ NEW Forge Modding with Minecraft 1.20.X: https://url.kaupenjoe.net/CourseForge120X ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 * ▶️ Complete and Roblox Lua Game Development: https://url.kaupenjoe.net/RobloxCoupon *
== SUPPORT ME ON PATREON == ▶️ https://www.patreon.com/Kaupenjoe
== SOCIALS == Discord: https://discord.com/invite/yqxykanpWf Personal Twitter: https://twitter.com/Kaupenjoe
Instagram: https://url.kaupenjoe.net/tutorials/instagram Facebook: https://url.kaupenjoe.net/tutorials/facebook Twitter: https://url.kaupenjoe.net/tutorials/twitter TikTok: https://url.kaupenjoe.net/tutorials/tiktok Written Tutorials: https://url.kaupenjoe.net/tutorials/blog
== LICENSE == Source Code is distributed under the MIT License. Additional Licenses for other assets can be seen below or in the accompanying CREDITS.txt on download.
== ADDITIONAL CREDITS == Outro Musik by Kevin MacLeod: “That’s a Wrap” Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 3.0 http://creativecommons.org/licenses/by/3.0
== AFFILIATE DISCLAIMER == * Some of the links and other products that appear in the video description are from companies which I will earn an affiliate commission or referral bonus from or are my own products. This means that if you click on one of the product links, I’ll receive a small commission or additional kickback without any additional cost for you. This helps support the channel and allows me to continue to make videos. Thank you for the support!
== HASHTAGS == #Minecraft #MinecraftModding #MinecraftTutorial #Kaupenjoe