Let’s let our trees go strong and big and let’s add trees and tree generation to minecraft all right francis back in intelligent once more and in this tutorial we’re going to be adding some custom trees and tree generation to minecraft now what’s very important is that please note this Tutorial is going to be in 118.2 because we have updated in the second to last tutorial where we updated from 1181 to 182 so be sure to check that out and keep that in mind because in the world generation some of this is a little bit different compared from 181 to 118.2 so Keep that in mind well first of all however we’re going to add some new blocks and that’s going to be first and foremost at the very bottom here what we’re just going to do is we’re just going to copy over the jacaranda planks twice and one of them is going to be the Jacaranda leaves of course changing the name here as well leaves there you go and this is going to be a leaves block there you go and it’s going to copy over the oak leaves and then we don’t need the strength here and i actually don’t i’m not 100 sure about The requires tools but i think that the oak leaves pretty much handle this already and then what we can also do is we can call the non-opaque here and then let’s actually not call the required truth so that’s gonna be fine and then the second one here is going to be the jacaranda Sapling so that’s gonna be a very interesting block indeed the first thing that we need right we make a new sapling block what we’re gonna see is well sadly it has some private or protected access but once again we need to make a new mod sapling block class There you go and this is of course going to extend the sampling block right here then we’re going to hover over this create constructor matching super making sure that we change this protect it to public here and then we basically never have to take a look at that class ever Again once again one of those very strange things and when we see here the first parameter is actually a sapling generator now this one we don’t have just yet so what i’m going to do is i’m just going to leave this empty so that we you know have this actual arrow still Here so that i remember this and we’re also going to change this to the sampling oak sampling and then i believe both of those are actually not needed here so that’s going to be fine so this is very important that we keep this here because now we actually need to well create this Sapling generator before we do this however we’re going to finish both of these blocks so first of all we’re just going to get the grapevine here duplicate it twice and then we’re going to make the cut out layer for both the sapling and the leaves here as well that But they both require the cutout layer and then we also wanted to add something to the modern registries right here but we’re going to basically add the leaves there but they of course also burn right so this is going to be the leaves and the burn here should be 20 and this is 60 i believe well once again we can literally just take a look at the fire block just so that we are you know making sure that this is correct in the fire block the very bottom we should see this and then under the leaves let’s see Where the leaves there they are so burn chances 30 and spread chance is 60. so we’re actually at a 30 and 60 there you go but this is now the default vanilla values for our custom leaves as well and then of course we still need all of the json files so we’re just Going to do those in you know just quickly going through here all right let’s start with the block states json files so those are fairly well i mean really not that interesting they just point to normal block model files so nothing too interesting here let’s add The translation as well you know at this point should be all fairly self-explanatory after going through i mean i don’t know how many blocks we’ve gone through at this point but it has been quite a few of them then the block model json files are a little more Interesting at least for the sampling the leaves are as you can see just a normal block model json file however the the sapling here has a cross texture and a cross pattern so that’s very interesting it basically is displayed just like the flower if we take a look At the flower this is also displayed in a cross pattern so that is what is happening here and then for the item models the only interesting thing for the item models is once again going to be the sapling the leaves are a completely normal item model as you can See just pointing back to the block model and then the sampling here you can see if we take a look at this this one points the block texture of the jacaranda sapling because the texture that is displayed in a cross pattern is exactly the same as is displayed in the Inventory so we basically don’t need two textures for this but only one right so there we go add those textures as well and that would be it now all of the json files as well as the code is of course all available to you in the description below get a repository individual just As well and now what we’re going to do is we’re going to create a new package in our tutorial mod package right click new package for the world package and inside there we’re going to make a new package called the feature package and then inside of there we’re going to make Another package called tree and now finally inside of here we’re going to make the doubling generator so this is going to be a new java class called the jack render sapling generator there you go and this is going to extends the sapling generator class right here we’re going to hover over This implement methods we need the tree feature get tree feature method we implemented and what we’re going to do here is we’re going to delete this so that once again we have an error here because we of course need to still need to return something here so that we Don’t forget this this is a you know a very good trick basically where you’re like okay i’m i still have to implement something else before i can do this so basically making a error here so that you can see that it’s not going to work that’s always a good idea and then we Can go back into our modblocks class and we can just add a new jacaran or sapling generator right here and then the mod blocks are done and then we can basically proceed with the well the things that we need for the world generation so for some people who have Already made some world generation stuff including the tree for example you can see that instead of just returning a configured feature here we actually now return a configured feature inside of this registry entry that is pretty much the extent to which this has changed a few other things and the syntax have Changed as well but they are very minor however they are still different so well we’re just going to proceed in the feature package we’re going to right click new java class and this is going to be the mod configured features and this is going to be very very Interesting so i will be copying over the actual tree here but no worries i will explain best i can and then of course also everything is available to you for download as well so the first thing is that it’s very important that we think about what is happening here For the tree to spawn from a sapling we need this configured feature of tree feature config right here so this is exactly the thing that we need to return right here so we can already say mod configured features dot jacker and the tree and then the sampling is done so This feature right here spawns from the sapling a custom tree that is the general idea and this tree feature config is responsible for how the tree looks we can see in this builder we’re passing in first of all a block state provider of mod blocks jacaranda log This would be the block that is responsible for the well the trunk of the tree basically and then we’re placing it down with a straight trunk placer so if i middle mouse button click on this and go in here we can actually see if i click on the trunk placer and Press ctrl h you can see that there are different types of trunk placers there’s a forking the large oak giant trunk blazer dark oak bending so there’s different types of strong placers and in theory you could even make your own trunk placer we’re definitely not gonna go into detail on that some intermediate To advanced java knowledge would be required to make some custom trunk placers but it is definitely possible then the second block state provider that we’re adding here are the leaves and then the foliage placer here is basically responsible for placing those down so if i middle mouse click on this Again and then click on the foliage placer press ctrl h and once again see different types of foliage placers and of course once again this would be you know possible for you to create your own when it comes to the numbers i highly recommend just playing around with them For the straight trunk placer you can basically see that the way that this works is that you have a base height a first random and a second random height for the straight trunk placer and in the background a little bit of math happens and then you get a little bit of a Randomized size for your trunk here once again i cannot stress this enough take a look at some of the vanilla classes it’s highly recommended right and last but not least we have the two layers feature right here so this one i’m not 100 sure just like with a lot of stuff in world Generation there’s a lot of complicated things there i believe that this sort of limits how many how big the size of this feature is and then how many features can spawn like next to it something like that i highly recommend once again just playing around with the numbers a little Bit be open to experimentation and then you’re gonna be fine i have one more note for people who want a tree that grows on something else than dirt this is very important for you so what you have to do is you have to make a in the Mod sampling block right here what you have to do is you would have to overwrite a method from the plant block actually and that is going to be the can plant on top so you would overwrite that method right so can plant on top you would overwrite it and then make sure That you can you return a true when your floor right here the block site of the floor is whatever custom block you basically want to be added in so and once that is done what you also have to do is here before the build you have to Add the dirt provider right here this is just a block state provider one more time and then here you just put in a block state of the block once again that you want your custom dirt to be so to speak and that should pretty much allow You to place your custom sapling onto a different block as well as spawn the block from the sapling right now with this our tree is pretty much done now there’s actually one more important thing that we need and i’m actually going to copy over the method here because it’s just not that interesting Is this the register configured features method which is very important to be called at the very top of the uninitializer method so i’m not 100 sure why that is the case but it just is what it is so make sure that this is called at the very top here and then everything Should be registered fine but then what i recommend doing is when we want to take a look at some of the vanilla stuff you can see that we have this blue line right here so we want to basically add the sources once again so what we’re Going to do is we’re going to open the terminal and do dot slash gradle w then sources so this might take you know anything from a few seconds to like a minute or two minutes depending on your internet speed so i just recommend being patient and let this run through and Then we’re gonna see what we can see or you can see build successful in 59 seconds so now we should be able to do in the shoe sources we should be able to use the mapped sources right here so we can say okay and then we should get you Know proper sources right here you can see that this already changed quite a bit and we can even see the strike trunk placer has changed a little bit the actual bar at the top is gone so i highly recommend doing this because um you know we’re gonna be able to go Through this way easier so for the vanilla stuff right i cannot recommend this enough take a look at some of the vanilla examples that you have available and this is exactly what we’re going to do so we’re going to go into the tree feature and i’m going to see where is This used to go into it middle mouse one click on this and then middle mouse button click on this and you can see this is all used in the tree configured features class we’re just going to go in here for for example this one right here Which is the dark oak registry entry of configured feature of a tree feature config and if we go in a little bit you can see pre-feature conflict.builder you know block state provider trunk placer that looks eerily similar to exactly what we have here and this is exactly right because this is pretty much Exactly the same thing so we’re going to see where is this configured feature now used we’re going to middle mouse by click on this you can see of course it’s used in the sampling generator makes a lot of sense because we’ve used our custom one as well in our custom Sampling generator and now here it’s also used in the tree placed features class so we’re going to go into here and you can see this is a registry entry of place feature of dark oak checked and what we’re just going to do is we’re just going to literally copy this entire Line over right so i basically want to show you one example of how you could do this and you can see right place features.register this is of course now not the dark oak checked but this would be our our jack ren the underscore checked then same here with the name jacaranda underscore Checked and instead of having this the dark oak this would be the jacarenda tree then here the place features that would survive is of course now our model blocks that our jacaranda sampling now what does this craziness do well this craziness obviously makes a place feature that should be fairly Straightforward but then what is this for example this would survive here well this would survive is really cool so basically we when we place this feature right so we’re going to place a feature into the world which would be our jacarender tree then this is only placed where the jacaranda sapling would Survive because if we wouldn’t have this then the tree would just spawn into the freaking sky and that would of course not quite be what we would want now what’s really interesting here is that when we continue with this right so the dark oak check right here is then used in Line 68 so we can see what is this one and this is once again a configured feature this time of random feature config here and you can see this is the dark forest vegetation and you can see okay that’s another configured feature and whether this used well this is used In another place feature called dark forest vegetation one more time and you can see that what we’re doing in vanilla basically is we’re going from a configured feature to a place feature to a configured feature to a place feature and this is exactly what we also need to Do so what we’re going to do is i’m actually going to copy over the already prepared configured feature here and you can see this is pretty much almost exactly the same thing as we have seen here so this is the configured feature the dark forged vegetation you can see This one takes in or let’s actually look at this one you can see that this is just the a random feature entry right here of you know a certain tree feature with a certain type with a certain chance here and then another one right here so this is pretty much exactly what We’re doing here you can see this is the jacaranda spawn i call it and this is a configured feature we’re registering that with a random selector and then a new random feature config where we check take this checked right here 50 of the time and the other 50 of the time we’re Going to take the exact same place feature it just is how we have to do this for the time being but this is going to be totally fine so this pretty much just allows us to make a configured feature out of this place feature because we actually need a configured Feature in order to make another place feature out of it if this sounds very complicated to you or you know it’s just like a little bit confusing then then i can just say well i mean this is pretty much the world generation for you in a Nutshell it just is what it is sometimes there are going to be some you know strange things in the world generation but i’m sure that we will manage to get through this especially with a little bit of java knowledge you should be fine we actually need a new class in our Feature package and that’s going to be the mod place features class so mod placed features there you go and then we’re going to make the placed feature out of it now i’m once again going to copy it over but everything here available to you in the description Below and individual just as well and also if i take a look at the vegetation placed features class right here you can see that those are pretty much almost the same thing i believe that the one we’re using is the count extra right here for the trees planes for example so This one in line 81 is exactly the same pretty much that we’re using right here you can see we’re making a new place feature right register event of place feature and here we are once again registering it was taking the spawn right so this is the configured feature Right here that’s what we need and we’re then making a modifier here of how to set this down and the way we’re setting this down or the way we’re spawning it is with the create count extra modifier so what does this do well we’re basically setting down one tree per Chunk i believe it’s or you know per feature size something like that highly recommend playing around with the numbers of course as well and then you have a 10 extra chance of placing two more down now you can of course change this right this would be 20 This would be 50 90 and so on and so forth this would be 100 so it should be fairly self-explanatory on how to use this so if you want you know a tree that like really really freaking super rare you could do something like this so there’s a like a One percent chance that one extra tree spawns something like that but that would be definitely very very uh rare so highly recommend playing around the numbers and if you’re when you’re testing you probably should do like 5x or 10x of what you actually want to do in your actual mod because otherwise it Might be very hard to find another question is how do we spawn this tree well the way that we’re going to do it is in the world package we’re going to make a new package called gen and inside of there we’re going to make two classes One of them is the mod tree generation and then the other one is going to be what i call the mod world gen now the mod world gen is fairly straightforward we’re just going to make a public static void and this is going to be the generate mod world gen Method right here and we’re going to call something from the mod 3 generation there in just a moment so what we’re going to do is here we’re going to make the we’re going to make the public static void generate trees and then in here all of our tree Generation will go and then what we’re going to do here is we’re going to do bioma modifications dot add feature we’re going to make a biome selector so this allows us to select what biomes this spawns in you can see we can say categories all found in overworld we can Do tags we can do built-ins we can do you know another in end we can even exclude certain ones only you know spawn it in certain ones that’s really freaking awesome we’re going to choose the category i’m just going to do biome category planes that’s what we want to Use and then after that we’re going to do a generation step and you can see it already suggests us here vegetable decoration this is exactly what we want to choose and then we want to say mod place features and you can see this will then basically generate our tree once this is called Only in biomes that have the planes category so that’s very important and it’s also very important to choose the correct generation step here it’s incredibly important make sure to choose the vegetal decoration for this should be fairly self-explanatory that this is vegetal decoration and then we’re going to say model 3 generation.generated Trees right here and the more the world generation method should then be called at the bottom right here so this is going to be more world gen that generate more world gen and that finally concludes of all the craziness that we have to do like you can see There are some very major steps overall each step is not that crazy however you know understanding like what is actually going on here with the configure feature to the place feature to the configured feature to the place feature can be some you know a little crazy sometimes but Once again i highly recommend just checking out all of the vanilla stuff that you have available all of the world generation from vanilla you can basically take a look at some of it is more complicated some of it is less complicated but it is just all available Here and i mean i can’t stress this enough the vanilla code examples here are probably the best resource that you have available for you to take a look at how this works but for the time being this should pretty much be all of the things that we need so let’s create a New world and let’s see if it works all right found us back in minecraft so let’s just locate a plane’s biome and let’s see if we can find our custom trees our jacarender trees and there they already are already spawning here you can see there are some and i believe That this is actually the extent of the planes biome funnily enough so this is actually the size of it is okay let’s actually take a look at a bigger planes biome because that’s um i would say just a little bit too too small to actually see the effect of The custom world generation let’s see if this plane’s volume is a little bit bigger hopefully um so i mean it is a little bit bigger yeah there you go so this is probably like a um oh it’s still just a plane spine okay so there you go You can see the trees spawning there they are so this is exactly what i wanted to see you can see a lot of them spawning but what’s very important is once again of course also that you have added your logs to the logs tag so if you’re if your leaves are Despawning then that is the reason why i highly recommend checking out the wood tutorial one more time on this then we can also see that the jacaranda sapling and the jacaranda leaves of course are all added successfully so let’s actually spawn a tree as well just so that we Know that this also works but i’m fairly confident that it does and there we go another custom tree spawned as well isn’t that just great and that’s you know i mean i wouldn’t say how easy it is but those are basically the steps that you have to take for your custom Trees to spawn in the world right like always of course all of the code is available to you in the description below get a repository an individual gist as well but that would already be it for this tutorial right here i hope you found this useful and you learned Something new if you did or very much appreciate like and 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 | TREE & TREE GENERATION’, was uploaded by Modding by Kaupenjoe on 2022-03-25 14:59:52. It has garnered 3837 views and 105 likes. The duration of the video is 00:20:19 or 1219 seconds.
In this Minecraft Modding Tutorial, we are adding custom Trees and Tree Generation to Minecraft 1.18.2 using Fabric.
== ASSETS & DOWNLOAD LINKS == GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Fabric-Tutorial-1.18.1/tree/34-treeAndTreeGeneration Gist: https://url.kaupenjoe.net/yt248/gist Tree Textures: https://url.kaupenjoe.net/yt248/textures
== TIMESTAMPS == 0:00 Intro 0:38 Adding the Leaves and the Sapling 2:15 Adding the Render Layers 2:28 Making the Leaves Flammablev 3:10 Add the JSON Files 4:28 Creating the Tree Generator 5:55 Making the ModConfiguredFeatures Class 8:26 Note on A Custom Tree that grows on Non-Dirt 9:17 Adding the register Method to the Class 9:42 GenSources to see the Vanilla Source properly 10:20 Looking at the Feature Class for Vanilla 12:00 Continuing to make the Tree Generation 14:17 Making the ModPlacedFeatures Class 15:52 Making the Tree actually Spawn! 18:26 Demonstration 19:59 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 *
== 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
== AMAZON AFFILIATE LINKS == Amazon Referral [US]: https://url.kaupenjoe.net/amazonref/us * Amazon Referral [UK]: https://url.kaupenjoe.net/amazonref/uk * Amazon Referral [DE]: https://url.kaupenjoe.net/amazonref/de *
== 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