Hang on guys technology here and welcome back to another minecraft morning store for version 1.5 dean in this story we’re going to be going over how you can create yourself some particles so let’s go ahead and get started so the first thing we’re going to want is our Particle in it so let’s create that’s in here we’re going from once the public static final third registry and this will be off of particle type and we are going to call this particle types and this is just going to be e to a new deferred register and this will take in Four registries particle types and our mod ID which is tutorial monomer ID next we need to go ahead and create the public static final registry object and this is of particle type and that will be off of our colored particle data so I don’t know if I explained this already But the particles I’m going to be creating are basically grayscale ones and you colored them when you spawn them so you choose the color where you spawn it so that’s the kind of particles I’m going to be creating today and I’ll have a future tutorial on just ones that are Already colored and you just born those in you have to worry about making the color yourselves and but this is just a bit easier so we’ll be doing that too first let’s call this variable colored particle and obviously that’s going to be two particle types register first this obviously takes in the registry Name which is going to be colored underscore particle and then it takes in a supplier of a new particle type first is a boolean for when whether it always shows so I’m going to set that to false and then it is the deserialize err which we haven’t created yet but that is just Going to be our colored particle data dot deserialize and if you just go ahead and import registry objects and particle type we should fix some of those errors and now we just need to do one more thing well two more things first we need to create this class and we need to make This class an event bus so that is an @ mod event bus this will obviously first take in our mod ID then it will take in the box which is the bus mod and then we need to specify that it is client size so you can do value equals desktop Client and just import bus mod and dist now we don’t need it’s not necessity that we tell it that it’s client-side but it just helps it solves any future problems that we could have but now we need to actually register the particle Factory so this will be a method which is a Public static void register particle Factory and this will have the annotation at subscribe event this will take in the particle factory register events and we’ll call that event in here we’re going to do minecraft and get instance dot particles but register factory first will be our particle type So parts go in it or color particle get and then it will be the particle factory which is just colored particle dot factory colon color on you okay and it will want us to suppress this so we can have a suppress warnings of resource okay so now we need to go ahead and Create this colored particle class so I’m going to do that in my particles package this class is going to extend sprite textured particle first we are going to create three variables and they will be private doubles and that will be for pause X pods Y and positive Z then We need to go ahead and create the constructor which we should be able to get from up here okay and we just need to make sure this is public and not protected and get rid of this comment now we can go ahead and rename these so For the first one is world the second one is the scored in third one is the wine cordon the fourth one is the Z coordinate the X speed the sick one is the Y speed and the seventh one is the Z speed because then we need to go ahead and add two More so that will be the data and the sprite so that will be a colored particle data and we’ll call that data and it will be an eye animated sprite and we’ll call that a sprite since we just need to change these supers to what We have up here I’m just going to go ahead and do that and we need to set a few variables so first we can do this stop-motion X and we can set that to X speed in and the stop-motion Y is equal Y speeded and then the stop-motion Z is Equal Z speeded so then we’re going to do this dot pause X it equal to the x coordinate also do that for y and z and then we can do the particle scale so this basically a random value so we can assign that to 0.1 F and then we can Multiply that by this R and don’t next float and then we can multiply that by point to Beth and we can just add 0.5 and I have simply just gone that from vanilla so I am as you’re going to change it again a bit and I’m going to Change this to plus one point to F to make it in fact no plus 1.7 F to make it a bit bigger and easier to see you can obviously set this to whatever you want this just adds some randomness to it lastly you can go ahead and do that if You wish and then we need to set the particle red particle green and the particle blue now this is mostly just a bunch of random values to make it slightly different each time so I’m just going to paste this in and we also need this float F variable Which we are multiplying by and then we need to set the max age so that there is some randomness to how long the particle lives forth we just need to cast an int to math.random times 10 point D and then I’m going to add 40 onto the end of that To make it at least 40 okay so that is it for the constructor next is the tip method so basically what it does while the particle is alive how it moves around and all of that here is basically just a bunch of random maths for how you Want it to move around so you can basically go ahead and implement that yourself but there are a few things that you do need so you need to set the previous pause to the current pause and then we need to make an if statement to check if This dot age incremented is greater than or equal to this stop max age if it is then we want to set it to expired and we do that by a this set expired then we need to override the method get render type and in here you basically just Return the particle render type that you want so I’m going to be returning particle sheet sheets opaque then we need to go ahead and create the factory class which is only in the client side and we can make sure it’s only client side by doing the annotation at only in And that will take in the disc which is disc client this class needs to be a public static class and we will call that factory and this is going to implement I particle factory and this will take in our colored particle data in here we first need to create a Variable for the I animated sprite and we’re going to call that a sprite set then we need the constructor which goes ahead and takes in the sprite set and then we just need to go ahead and initialize that then we need to override the method make particle and in here we Just basically create the particle so we can create a new instance of our colored particle then we need to tell it to select the sprite randomly out of our sprite sets and if we do this by doing particle dot select sprite randomly and that takes in the sprite set and we just Return the particle now that we have done that we can go ahead and create this colored particle data class so this will be a public static class the colored particle data and this implements eye particle data in here we first want to create BD serializer so that is a public static final I Particle data deserialize ER and that will take in our colored particle data it’s going to be equal to a new AI particle data dot d serializer of our colored particle data in the in deserialized method we basically need to go ahead and get the red green blue and Alpha from what we put in so we do that by doing reader to expect and we just expect a blank chart and then we can create float red is equal to a float of reader read double and then we are going to do this for green blue and alpha and Then after that we just return a new colors particle data taking in a red green blue and alpha then for the read method we can just return a new colored particle data and it’s just the buff over reading the four floats then we can come out this DC area Lizer and create Free private final floats and that will be red green blue and alpha then we just create the constructor and this takes the red green blue and alpha in then we just need to go ahead and initialize the red green and blue however the Alpha is slightly different So that will be math helper clamp and that first clamps the Alpha and then it’s the minimum that it clamps from so that will be 0.01 F and the maximum is 4 point other then we need the right method in here we just do buffer dot right floats and then it Would be disc top red and you do that for green blue and alpha and we override the method get parameters in here we return stringed off formats first is a locale route and then it is the string that we are formatting so first will be percentage s which is the particle type Then it is percentage point 2f and then it is percentage point 2f again and then it is percentage point 2f again and then it is percentage point 2f again the first one we want to assign to registry particle type dot get ki and so that Takes in this don’t get type then it is this dot read this green list of blue and this dot alpha and we can just add a suppress warnings off of deprecation on that then we can go ahead and override the method get type in which we just returned our possible in it colored Particle dog get then we can override the method get red get green and get blue and get alpha in which these methods we just return this don’t read this doc green this blue and this dot alpha you do however need to make sure these have the app only and discpline Annotation as we don’t want those to be got on the server and that is it for this class we just need to go back into our path for it to import this class and then give that a save and that will fix our error that we had here and that is It for that obviously we need to know now go ahead and register this so we go into our main class and before everything we go ahead and do particle in its dot particle types don’t register than what event bus now that we have done that I’m going to show you what you Need to do to go ahead and spawn this particle in your world so I am going to spawn it in our speckle block and I’ve commented out this lightning thing because it’s quite see with the Lightning showing up as well and in here we just do well to add Particles this takes in the particle data which is a new colored particle or colored particle data and this just takes in the color that you want so I want it to be completely green so I’m going through 0 1 0 and 1 so see this is Red green blue alpha then it is the position so that it’s just going to be positive get X plus 0.5 get y plus 0.5 and positive get Z plus 0.5 we are adding 0.5 is in the center of the block it just makes it a bit easier to see the Particle and when we do that and here you can see we have the speed at which I’m just go set to zero for all of them just so it doesn’t have any weird motion okay so now we need to go ahead into our assets and in the we need to create a New package rule particles and here we’re going to create a new file and we’re going to call this colored particle Jason that name should need to be the same name that you put your registry name in Pascal in it in here we first want the textures which is an Array and then we want the different textures that you can have for your particle so I’m just going to have free textures so I’m going to have colored 0 colored 1 and colored 2 so this will just be tutorial mod hold on and then it Will be the name of your texture as it already knows where the texture is it just needs to know the name of it and I am now going to just copy this and paste it twice as I have three different textures and I’m going to change that to One and two now if you go into your textures package you need to create a new package called particle and this is where you’ll put your particle textures these need to be 16 by 16 as normal but you need to make sure they are greyscale if you are following this tutorial now That you have done that you can go ahead and run the game and it should work okay so guys I did actually forget this else statement in here which is actually what does the motion I heard and that is something I totally forgot about so you just need to Go ahead and do that it’s basically just a math load math do you get it moving around you can look up vanilla particles if you want to see how it’s done for example direct particle if you look in here you can see how it just does Does some maps here to move it down you can put loads of vanilla particles like firework particle okay so guys I am now in the game when I click it you can see my particle comes up it’s a big little thing I did the motion slightly wrong I Think but as you can see it’s bright green because we set it to no blue no red the full outfit and full green if you look very closely it’s different every time and it’s not the same because we have the animated sprite which selects a Random one so yeah as I said I will be doing a tutorial on one so already colored and not grayscale in the future but I’m sure you can figure that out yourself anyways but yeah if you guys enjoy please do be sure to smash your face into that like button and subscribe If you’ve really enjoyed please do be sure to share it and a yeah I will see you guys in the next video good bye Video Information
This video, titled ‘Minecraft Modding Tutorial 1.15 | Episode 38 – Gray-scale Particles’, was uploaded by TurtyWurty on 2020-06-02 15:45:11. It has garnered 1957 views and 66 likes. The duration of the video is 00:16:55 or 1015 seconds.
Hey guys, TurtyWurty here, in this video I show how to make grey-scale particles which can be coloured when you spawn them. Note: In the future, I will be doing a tutorial on non-grey-scale ones. But I hope you guys are all doing well during these times, and staying positive. But with all the free time, you can now learn Java!!!! Hope you guys enjoy, all links are below VVVV!
My Discord Server: https://discord.gg/d5cGhKQ Episode 37: https://youtu.be/8X46-Kbcn1c My GitHub: https://github.com/DaRealTurtyWurty/1.15-Tut-Mod Tutorials I will be doing: https://trello.com/b/LNQlC0l1 A Free Java Course that I would really recommend: https://www.udemy.com/course/java-tutorial/
I would just like to apologize for the lack of videos recently, it is just that editing them has honestly got really painful and boring to the point where I am never in the mood to do it xdd.
Minecraft Forge 1.15.2: https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.15.2.html