Hello hello hello everybody and welcome back to another minecraft running tutorial for version 1.19 in this tutorial we are going to be making a custom flower so this is something i don’t think i’ve ever actually made a tutorial on however it’s something that i’m making so that i can do Flower generation in a future tutorial because i think that would be something a little bit interesting and i think people would be interested in it so let’s just get started shall we so all we need to do is come into our block init and we need a new block so let’s go Public static final registry objects now this is going to be of type flower block and this will be called example that’s what flower is equal to register example let’s draw flower and then we’re going to give it a supplier of a new flower block now first is going to take in a mob Effect now i know that’s probably quite strange like why why why does a flower need a mob effect that’s slightly weird but this is for suspicious stew so i personally don’t really know anything about suspicious stew all i know is that is you make it with flowers or something And you get an effect from that suspicious stew depending on the flower so um the effect that i’m going to put in here um i don’t know what one’s a default so i’m just going to put dig speed in there and then you have another integer so not another industry you have another Parameter which is the integer which is the duration of the effect so how long it lasts just going to give it 300 and then you just have block properties so block behavior dot properties dot and i’m actually going to use something i haven’t really talked about yet and That is copy so this allows you to copy from a specific blocks so just copy their behavior and i’m going to copy from blocks dot um i’ll copy from dandelion there you go and also of course we need to supply the default uh item properties so that it can create our block item Item.properties.tab and that’ll be tutorialmod dot tab and if we just plug this on a new line bring it over there we go that is that um yeah that’s it so now you may think that would work but that will not work so there is one thing we need to go ahead and do And because flowers are they have transparency right so there is sort of holes in the texture if you will it means that this won’t work by default because the way minecraft works is by default it assumes every texture is opaque so it will fill all of the transparency with black And that’s not great because you don’t want a black box as your flower so we need to go ahead and create a new class and how should we do this there are many ways we can do this but what we need to do this basically is an event And we need to set something called the render type so let’s create events um we’ll call this mod client event will that work that won’t work okay for now we’ll just leave it there i’ll move it later now this class needs to have an annotation which is at mod dot event bus subscriber Now this first takes in the mod id and that is tutorial mod.mod id then it takes in something known as the bus and that needs to be bus dot mod and you’ll need to import that so it’s mod event bus subscriber mod and finally we need something known as The value and that is just this dot client i’m not really going to explain any of this because i want to make a separate events tutorial in the future but essentially this is our mod id here this is the bus that it runs on which is Either the modbus or the forge bus and then this is the side that it will run on so specifically we want this to run on the client side then we need to have an annotation which is at a subscribe event and then we need a method which will be public static void And then we can call this client setup and this will take in an fml client setup event which we can call event and then all we need to do is do item block render types dot set render layer then this will take in the block that we Want to set it for so for us that is blocking it dot example flower dot gets and then it’s just the render type so that will be render type uh colon and we want to use cut out we actually can’t do that has to be just a normal called method Fantastic and that will now work the final thing we need to go ahead and do is obviously as usual the jsons so let’s come into here let’s create block dutch tutorial mod dot sample underscore flower and that’ll be example flower then let’s go into our block states And i’m just going to copy example block and change it to example flower flower fantastic then let’s come into models block and change it to example flower now this is going to be slightly different because flowers are obviously not a full block they are instead a sort Of cross shape so what we need to use instead of cube underscore all as the parent is cross and i believe all changes to cross i’m just going to check that real quick okay i have just confirmed that is correct it is indeed cross that’s exactly how i thought it would be And finally we need to go ahead and do the item model so the item model for flowers you generally actually want to use a normal item model rather than a block model and i’m going to do the same so all i need to do is say example underscore flower but instead of using Items here because our texture is in the blocks folder we need to use blocks and there we go that will be our flower let’s just make sure our texture is here yes it is i just copied the allium to be honest and did some minor adjustments And that is it obviously you might want to do the loot tables as well let’s just do those that’ll be very very quick example let me stop flower fantastic and boom that’s it we now have a flower so let’s go ahead and run the game all right as You can see we’re in the game so if we place down a flower pot and try to place in our flower that won’t work i’ll explain why in a minute but we can place down our flower and it doesn’t have any transparency issues and obviously it can be replaced placed On the correct blocks you can’t place it on wood for example you have to trust me i’m clicking that right now and uh yeah obviously it should also break and drop itself which it does fantastic so why didn’t the flower pot work well it’s because we actually need to go Ahead and register a flower pot block so luckily that is super easy to do and you know we’ll do it in this tutorial why not it’s only going to take a few seconds so let’s just close the game and just wait for it to close there you go Okay let’s come into our source main java let’s come into our block in it and we need to do public static final registry objects this will be of flower pot block example and just got flower under scroll part is equal to and this time we’re not going to use our register method because We don’t want to block item for this so we’re just going to use blocks dot register example and scroll flower and scroll part and then we want a supplier of a new flower pot block now this is first going to take in our flower so that will be um example flower And then it’s going to take in the behavior right so block behavior dot properties dot copy and we’ll do blocks dot flower pot fantastic now you see that doesn’t work and that’s because it actually needs to be blocking it dot example flower and it doesn’t like that why doesn’t it Like that did i do that wrong Ah of course so this essentially is right that’s fine um however we need to define what the empty pot block is and we can do that by using blocks dot flower pot and then this supplier like that it doesn’t like this wasn’t it like this The empty pot the flower block So do i need to cast this because have mojang done some jank here they have right okay there we go do that and then it needs a supplier of our block and we can just pass this in like it is because as i was saying a few tutorials ago registry objects are just Suppliers so we can just pass that straight in that’s fantastic now the other thing we do need to make sure we do is once again go ahead and set the render layer render type i mean so we can once again do item block render types plus that render layer Blocking it dot example flower pot dot get render type dot cut out fantastic so the other thing we need to go ahead and do is we need to do the jsons okay so let’s just minimize these let’s first do our lang although it doesn’t really matter but we’ll do it anyways So tutorial march colon not poland example i just got flower and pot and i’ll just call this a potted example flower fantastic let’s do the block state so this is just going to be a normal block state nothing too special and that finally we need to do the lock model So for example underscore flower part now this is once again going to be slightly different we need to use instead of cube underscore all the parent needs to be flower underscore part underscore crops and instead of all here we need to use plant and once again change this to our flower texture We can go ahead and do an item model if you want just in case somehow there was an item but i’m not going to bother with that because i know that’s not going to be an item that just wouldn’t make sense final thing you can go ahead and do the Loop tables so let’s come into here now i’ve already got a loop table generator and i’ve grabbed the preset um potted allium as mine it doesn’t really matter which preset however you can just download that and plonk it in there so example underscore flower and just got parts and then just save Close it and if you come back into here let it load Maybe Hello oh i accidentally put it in recipes didn’t i i did oops factor fantastic so now it’s in here and it should all be good and done so let’s once again go and run the game and let’s see if it works and voila if we grab our flower which i don’t know Where that’s gone then we should be able to place down our pot and place a flower in it um apparently not okay so i have just gone and had a look at my code that i was looking at and we missed something so there was two things That i slightly messed up so let’s just close this okay the first thing let’s come into our main class and actually let’s not do it in our main class let’s create a new class let’s call this mod um common event right this is going to be another event class And that means it once again needs the mod advent plus subscriber annotation and we need to pass in the mod id also the bus which is bass dot mod now in here we need a subscribe event that’ll be a public static void common okay thank you intellij And that will take in an fml common setup event event and in here we need to make sure we do event dot nq work and there isn’t is because we don’t want this to happen straight away we want this to be enqueued to make sure that it All happens at the right time because initially this event does not really run at the right time per se it’s a little hard to explain without explaining exactly how forge works internally but essentially you just need to make sure you enqueue it and then basically what you need to do Is you need to do blocks dot flower pot and then you want to call add plant now this is a method inside of flower pot block however because this is stupid mojang is stupid we actually have to make sure we cast this so let’s just cast to a flower pot block Did that slightly wrong it’s meant to be like that like that i messed up my brackets there is that right no one more there we go now we can call add plant and we need to pass in uh our flower first and to do that there’s actually a really Simple way so we can do blocking it dot example flower now for whatever reason this requires a resource location which is really strange i don’t know why it doesn’t just ask for the block but whatever we can just use get id and that just gets the resource location For us it’s pretty nice actually and as the second parameter this is what the actual full flower pot block will be so that can just be blocking it dot example flower pot and as i was saying earlier this already works because registry objects are essentially suppliers And fantastic that will work and you can just do that for all of your blocks fantastic so now we should be able to go ahead and rerun the game oh and it should work this time and here we are so if we place down our pot we can Now place in the flower and fantastic and obviously that will not break like that because of course that’s not how flower pots work i completely forgot for a second um but yeah so that should actually be our block which we can check f3 if we go On the right you can see up here example flower pot and obviously example flower and flower pot so yeah that’s pretty much it well that is it um so i hope you guys did find this tutorial useful if you did please do be sure to smash your face into that like button And subscribe you really enjoyed and found it useful please do be sure to share it and uh yeah i’ll see you guys in the next tutorial good bye bye Video Information
This video, titled ‘1.19 Minecraft Forge Modding Tutorial – Flowers’, was uploaded by TurtyWurty on 2022-07-21 16:30:05. It has garnered 1106 views and 37 likes. The duration of the video is 00:21:33 or 1293 seconds.
Hello everyone, in this video we will be creating our very own custom flower along with its own flower pot!
In the next video we making our own paintings of different sizes! Remember, if you have any problems, please join the discord that is linked below!
–Links– Patreon: https://www.patreon.com/turtywurty Discord: https://discord.gg/BAYB3A38wn Github: https://github.com/DaRealTurtyWurty/1.19TutorialMod Trello: WIP