Let’s grow big and strong trees and add trees and tree generation to Minecraft oh right my friends was back in jail there was more in this tutorial we’re going to be adding a custom tree custom tree generation to Minecraft now this will involve quite a few interesting things namely the data generation from Last tutorial so this is a prerequisite if you don’t have the data generation then you will need to do this otherwise neither the trees spawning from the sapling nor the tree as tree generation inside of the world will work however if you’ve gone through this that’s perfect And we will split up this tutorial like it’s all going to be one single video however it’s going to split up in three different parts the first part is just adding the blocks and all of that craziness so the sampling block the log blocks the leaves and stuff like that Then after we’ve added that we will then do the tree from the sapling so basically we’re gonna make it so that from the sapling a custom tree will grow and then once we’ve done that then we will also add the world generation so that the tree will also spawn in Southern the world we will need a custom block class so in our block package we’re going to right click new Java class and this is going to be the mod flammable rotated pillar block this is a favorite of mine and this extends the rotated pillar block class and we’ll Hover over this crit Constructor matching super and then we need to overwrite a few things mainly we need to override is flammable we also want to overwrite the get flammability method we want to overwrite the get fire spread speed and last but not least we want to overwrite the get tool modified State Method and this is all for well this one here they get two modified state is for the stripped variance of our logs and then the flammability and the fire spread and stuff like that that is of course for the the pillar block so the pillar blocks are going to be the wood And the the logs and the stripped wood and the stripped logs for those to be flammable so we need to do true here because well I mean in this case the thing is actually flammable and then we want to do a 5 over here for the flammability and a five over here for The fire spread and that’s basically going to be the thing for the logs let’s just change the name over here just click on it shift F6 and then property to change the name and then this one here we will make a deliberate error just so that we don’t forget to change Stuff in here now usually when I have custom blocks in here I usually make a custom package I just call it custom so this is just for the custom block classes we’re just going to put this in here and then that’s going to be fine And in our mod blocks class now now it’s going to get very interesting we need a couple of things so first of all let’s just copy over the End Stone black opal ore and rename this this is going to be the ebony underscore log and then of course the name here is extremely Important that we change this as well ebony underscore log this is now a mod flammable rotated pillar block as we have clearly seen and this is not going to use the material the properties that of material it’s actually going to copy the block behavior from blocks.org Underscore log there you go and then of course we also don’t need the uniform int anymore and that is pretty much what we need let’s turn this down to like five and that’s going to be the Ebony Log now we want to copy this over four Times and then we want another copy for the planks and another copy for the leaves and then a last copy for the sapling so let’s start from the top over here this is going to be the ebony wood and it’s very important that we always change the name right here and then also What it’s copying so this has to be the oak underscore wood this is extremely important if you don’t change the copy over here then you might get an error that is extremely important so then we got the stripped Ebony Log and the stripped ebony wood right here and don’t Forget to change the name strip a mini log and stripped ebony wood so it’s it’s a lot of different things over here and this is going to be the stripped Oak log you could also use the other wood types but I just like to keep it consistent so I’m basically always using that this is the stripped oak wood there you go these are all of our four mod flammable rotated pillar blocks that’s fine this is now our planks over here so that’s the ebony planks and this is going to be ebony planks as well well taking from The oak planks very important and here this is no longer a mod flammable rotated pillar block this is now a normal block however is it really a normal block not quite because we actually wanted to make an anonymous class so inside of the registry register block method you can see this is the Closing parentheses for this one we want to go inside of one and then put in curly brackets and this creates an anonymous class so we’re basically overriding the block class sort of inline and I will actually just copy this over because it’s a little bit tedious to keep typing this out so we Basically just want to copy over and overwrite the is flammable method the get flammability method as well as they get fire spread method over here and we want to do the same thing for the leaves in just a moment so this is going to be The leaves and this is going to be the leaves as well but don’t leave just yet I have done the same joke again it’s a horrible joke but it is kind of funny and then let’s do leaves here and this is of course a leaves block also Important and then we can just copy over the contents including the curl early brackets place them inside of here and this actually is a 30 of flammability and a 16 fire spread because leaves are incredibly flammable in this case and that will actually ensure the flammability of the planks and the Leaves as well and then let’s just do the sapling here as the last one that is the ebony sapling and that’s going to be the ebony sapling there we go this is of course a sapling block there you go the first parameter of which is a abstract Tree grower now in this case we don’t have one so we’re just going to pass a null for the moment and also very important this is the oak sapling otherwise it will not work and I believe that we actually don’t want to do either of those yeah we don’t know either of Those and actually I believe for the planks we also don’t want to require a tool because planks can also be harvested with your hands and I guess you know you could do the same thing for the leaves here there you go just to keep it a little bit consistent this These are like the minutia or the details that aren’t that important but just keep that in mind as well now once we have this we can go back to the mod flammable Rotator filler blocks one of my favorite classes as I’ve said and I will just be cupping over the Contours Of this particular method because they aren’t that crazy to understand but I will go through and of course all of the code is available to you in the description below in the GitHub repository and you will see that basically we’re just saying hey if the Player has an X item in their hand and they right click this particular block right if the current block is an ability log then we’re just making it into a script Ebony Log and we’re retaining the axis that it is on right because of course a log you can place it down Sideways or upwards and that is very important that we retain that axis that is why this is in here if for example you would have multiple different logs then yes you would just add another you know couple of if statements change the mod blocks here change the block here And so on and so forth and what you would want to do long term if you have like an insane amount you could also probably just make a map and that would be a little bit easier but you know it really shouldn’t be anything crazy with some Java knowledge you should get Through this totally fine now on to the other things and that is well all of the block States and look at this we don’t have anything now it could just be copying those over but that’s not no fun at all because we have data generators Well let’s make use of them so let’s go into the block State provider over here and how are we going to make well make the logs and stuff like that well let’s just take a look do we have something like a log block absolutely we have a Log log so we could just say log block modblocks. this is going to be the ebony log.get and now here you’re gonna see this is an error because this is not a rotated pillar block so we can do dot cast and then just press the Tab Key to Autocomplete and we’re going to say rotated pillar block and this is going to work because we know that the mod flammable rotated pillar block is also a pillar block so this is going to be no worries at all so this is going to be for the longer that works now the others Those ones I will also be copying over once again the code is available for you this is should be fairly self-explanatory All Things Considered so this is going to be those are going to be access blocks and you can see that the wood over here just has a log Texture and a block texture of for the Ebony Log over here now the reason why this is the case because the Ebony Log texture is actually the wood right that’s the texture surrounding it let’s just copy off the textures here so those are all block Textures in this case and There we go and you can see that the Ebony Log right that’s the side of the of the log that’s the bark and that of course is the entirety of the ebony wood texture is just this and then the rest here I just basically put in a manually With resource locations and that’s fine as well we can just copy the block with item over here for our ebony planks and the ebony leaves that’s going to be fine and this is the ebony planks there you go so that is totally fine let’s actually keep it like this and what’s Also important is that these ones do not create the items so for that we also wanted to call we’re just going to copy this over once again if this is like oh this is a lot of copying over you should understand the this simple instruction shouldn’t be anything to crazy so Whether or not I type with this out or not you know simple block item just creates a simple block item for this particular block over here we’re basically saying hey we want an existing parent the parent is basically just itself so it refers back to the block Model file right so this is the same idea as in if we just go to the models over here item right this is the same idea as with this right so we’re basically referring back to the block model Json file with this one and what Is the parent of this well it’s just Q quote that’s all that there is to it so this should be pretty understandable all things considered and if you ever make another set of wood well just copy all of this over change to the other blocks and change the names and then that’s it That’s pretty much all you need to do now for the loot I actually also need to add this right let’s not forget to add this in the mod block loots over here because well otherwise they are now known blocks so if I don’t add this then It’s not going to work so all of the these are well this this is just like all drop self right because the those all drop themselves except for the leave for the leaves we want a special thing and that’s just this so that’s it’s not too crazy right for the leaves we want Another function for a block and this creates a leaves drop so this is the same idea as the create or drop here and we’re just passing in the block and then saying we get the leaves and it has a normal leaves sapling chance that’s pretty much all that there’s to it this Is the constant over here as you can see in the block loot subprovider class so that is all that we need for these ones and now we should be able to just run the data so once again run data over here and we shouldn’t get any duplicates Or or any errors but you know here’s hoping and then everything is going to be well properly added and then there’s just like a tiny thing that we need to do and then so as always this is an okay error the fail is fine as long as we get An all providers took x amount of milliseconds and if we just take a look at the loot tables we get stripped ebony logs that looks fine we get ebony wood this all seems fine oh there is actually an error over here so this is apparently VOD that’s that’s not quite right and it Actually happened right here so the name of over here is wrong so let’s just run data again and fix that quickly now that is done as well ebony would now proper name and then we can proceed in the tutorial mod class and we would just Want to add all of our stuff to some different tabs once again just for the sake of argument here I’ve just prepared this already we’re just going to add this all into the natural blocks in this case and that should be fine also why is there no ebony wood that’s kind of weird There you go that should be that and those are all the ones that we have except of course for the sapling which also needs to be added so this is going to be the sapling there you go and then in theory if you wanted to you can also Just add them to oh we already have one natural blocks over here that’s kind of funny though so let’s just put them in here and then we also put them into the tutorial tab as well there you go so now we have added them in both of them and That is fine now as is pretty evident what is missing here is for some reason right the sampling is missing yes indeed because well we haven’t actually generated the state for the sapling why is this the case well we actually need another helper method for this because While in Forge we just don’t get a lot of helper methods apparently for data generation which is kind of a shame really because it you know it wouldn’t be that bad to have some of those but you know we just have our own sampling method over here which is called Blockblocks.ebony sapling there we go and that’s going to be fine what’s important here is that we also add the dot render type cutout over here otherwise our sapling is not going to well look right basically that is a very important part about this whole equation Once that is done we can run data again though and then we should be able to see our block say Json file for the sampling for the block and the item as well and those should all also work then there we go all providers took x amount of Seconds and then we can see we got the ebony sapling here with the cut out render type exactly what we want and that should be everything that we need for our well for our books and and thus we can continue with spawning the tree spawning the tree actually needs some Version as well so we will make a new package in our tutorial normal package called world and then inside of there we’ll make a new package called tree let’s actually rename this to World gen I find that is a little bit better and then inside of the tree package though Will make the ebony tree grower indeed just like this this will extend the abstract tree grower we’ll hover over the script implement the method the get the get configure feature method and then let’s make a delivered Arrow right here because we do not have the resource Key as of now because for the resource key what we need to do is we need to have another new class that is the mod configured features class there you go and this one well this one is going to be pretty nuts now once again this is Going to be an instance where I will be copying over roughly line by line but I will be copying over stuff because there’s a lot of things that are just going to be the same every time so for example these two helper methods over here the register method in the register Key method basically just helps us to register our configured feature and here it just helps us to register the key for our configured feature that’s really all that this does does and it doesn’t need to be looked into too bad then the same thing goes for our resource key itself It is just a public static final resource key of configure feature Quest from our question mark we’re going to call this the ebony key and we’re going to call the key itself Ebony and then we will need something that is going to be very interesting indeed now if you’ve Done World Generation in previous versions of Minecraft so that is 9 119 2 and anything below then you will be able to recognize a few things but the one thing that you will not recognize is this public static void bootstrap method because that one is well new because This gets a bootstrap context exactly this one of type configured feature question mark comma question mark we’re going to call this the context and this will have the following this will have this will call the register method and it’s going to do the following I’m just I’m going to copy this over and you will see oh wait I’ve seen this before the tree feature and the tree configuration and the Builder absolutely this is literally exactly the same thing but it is now contained in this bootstrap method and you can see so the register Method works as follows we are passing in the context then we’re passing in the key that is going to be this particular feature this configure feature we’re going to say what kind of a feature it is we’re then we’re making the actual configuration here once again just to Sort of reiterate what this is doing the first block State provider that we’re passing in over here is just saying hey this is our log then we make a straight trunk Placer so we’re basically placing the trunk which is going to be this particular block State over here in a Certain pattern over here then the same thing goes for the leaves right we are going to place them in a blob foliage Placer pattern and then the two layer feature size once again has something to do with this morning and that is pretty much all that there is to it for the Tree itself let’s go back to the ebony tree grower and just say mod configured features that ebony key done and then we can go into our modblocks class and instead of a null over here make a new Ebony tree grower and that is it now we Can close this one we close this one and this one is also a pretty much almost done done because this is what we need in the mod configured features class we now want to actually generate this so in the datagen package right click new Java class and this is the mod World gen Provider and this one well well this one’s going to be interesting because this is going to be this is going to extend the data pack built in entries provider indeed we’re going to hover over this quick Constructor matching super just getting the first one that’s going to be fine because this this one Should be okay I’m pretty sure and we can delete the set over here and instead of the mod IDs we’re just going to do set dot of and then tutorial tutorial mod.mod ID and then what we will do is we will make a public static final registry set builder called Builder and This is equal to a new registry set builder dot add and then we’ll add the Registries dot configured feature comma mod configured features colon colon bootstrap and we will keep it like this for a moment oh configured Carver what is a core configure feature there you go And then the error should also go away and then we want to pass this in before the set so this is going to be the Builder and that should work as well this will now be called in the data generators class at the very bottom over here we’ll say Generator.adp provider we’ll just say event dot include server actually there you go and this is going to be a new mod World gen provider passing in the pack output and another thing and that is going to be the completable future of type holderlookup dot provider called look up look up provider equal to Event.getlookup provider and then we’ll just pass this in here local provider enter the semicolon and we can run data again and we should then get a new folder inside of our data folder which is going to be the configured feature so that’s going to be exactly this thing That we’ve made with you know basically in programming in Java we’re going to be generated as a Json file and we can see once again all providers took however many milliseconds we see a world gen folder configure features Ebony and here we have our ebony tree as a Json file Because as I’ve previously stated all world generation is now basically Json files now this will not yet make our tree spawn in the world that’s going to be in the next step this step is just making sure that our tree is going to spawn from from our sapling when we when Either it grows naturally or we give it bone meal let’s actually take a look if our sapling works but I’m pretty sure that it will and then we can proceed alright for instance in Minecraft again and first of all while our wood and even the trees and even the leaves have been Added successfully these sapling doesn’t have an item model but it does have a block model that’s totally fine we’re going to be able to fix that in just a moment let’s just take the bone meal and let’s actually see whether or not a tree spawns and indeed H3 spawns perfect Perfect perfect now what you will find is that all of the leaves are immediately decaying which is very very curious indeed we will be able to fix that as well so let’s go back into IntelliJ fix the leaves despawning fix the item model and also fix the Lang Over here while fixing that translation really is the easiest thing to do right literally just translating it that should be pretty self-explanatory and straightforward when it comes to the despawning of the leaves we simply need a new tag over here and that’s going to Be the logs tag and we can just put in here ebony underscore log and then we want to put in all of the different variants actually so this means we also want to put in the wood here and the stripped variants as well so this is Going to be the stripped wood and then also the stripped log and now once that is done the leaves should no longer despawn interestingly enough for the item we actually want to now make a simple item we actually wanted to make a very specific thing and that is probably Going to be just the sapling item it is a well in this case a specific one and that’s going to be the mod block start sapling and we’ll just do this as a get and then as an item over here we can also just say that it should be a block Because in this case it should be a block and then we just want to change this to the block over here because the actual the actual sampling item texture is under the block over here and that should be fine and if we were to run data now then well not only the block Item is going to get generated and it should work also all the other things are also going to work then as well and just to confirm like I said we’re now looking for the ebony sapling for layer 0 under the block ebony sapling textures because that is where the ebony sampling Is right and now that all of those things have been done now we can finally spawn our tree inside of the world as well now to spawn our tree inside of the world we actually need a placed feature and for this we need the mod placed features class over here this will look Eerily similar to the configure features class but instead of two helper methods we actually have three helper methods the create key method the register method and another register method over here now all of those are quite important and what we also have is a key for our ebony placed this time so this Is going to be the place feature and it will look well something interesting it’s going to look it’s going to be done inside of the bootstrap method again which is going to have a bootstrap context of place feature this time called context over here and then instead of here it’s going to be Interesting indeed because what we’re going to need the first thing that we will need is a holder getter of type configured feature and I’ll explain what all this insanity is in just a moment and this is the configured features I’m just going to call this configured features and this is equal to the Context.lookup Registries dot configured feature perfect there you go now this right here in as a high level overview simply allows us to reference configured features as well because in this case write a place feature our our ebony Place feature here right the ebony Place feature that we’ll do in just a moment Actually depends on our configured feature here because this is how our tree looks like and now we’re basically defining how often it spawns and how it can spawn so of course we need to we need to somehow get that configured feature and this is basically how we do It we call the register method we’re passing in the context we’ll then pass in the key again then we’ll use the configured features holder getter the lookup thing use get or throw use the mod configured features key over here the ebony key after the first closing parentheses we then want to actually do The placement so you can see we can either give a list of placement modifiers or we can just give multiple placement modifiers I will do vegetation placements placements this one that tree placement then we’ll use placement util dot count extra I will explain this in just a moment I’ll just put in the Numbers here then after the first closing parentheses we’ll put in mot blocks Dot sampling.get this is extremely important so what and then no more errors should be present and that should be fine what is this Insanity well first of all like I said we’re taking the ebony key over Here and we’re saying get me the the configured feature that has to do with this key so we’re basically getting this configured feature which is defined either here or in the configure feature Json file right here in the ebony Json file and we’re then saying okay we can Place this in the following way you can place this with count extra this means that we’ll Place three and then there’s a 10 chance of placing two extra you can also do two and you know one extra or whatever basically you want to do the numbers are always a thingy that you Have to play around with yourself the point one over here is an extremely important thing so I want you to play pay close attention to this count extra if we go into this you can see that the second float over here right this point one that we’ve done does some Insanity Over here the reason is that one divided by this number has to be an integer this means we can just like go through this one divided by 0.1 it’s 10 that’s an integer this is going to be okay 1 divided by 0.2 is going to be 5 that’s An integer as well 1 divided by 0.3 this is not an integer if you put in 0.3 over here you will get an error because this has to be divisible by a this has to be divisible look well this number has to be a divisor one divided by this has to Get an integer I have no idea why they did this I it’s the strangest thing you will then get Chance data cannot be represented as a list weight keep that in mind if you get this error that is what it means so if this always worked this only works With like point one point two point two five and so on and so forth so one divided by this number has to be ninja otherwise it doesn’t work so just keep that in mind and then the ebony sampling here we need this because and this is also extremely important because we only Want our tree to spawn in areas where our sapling could theoretically survive in right so this means everywhere where there’s dirt we don’t want our tree to just spawn inside of a you know inside of other trees for example which is the thing that some people might report if They do not have this and this is why we need to add this and finally in our world gen provider we can just add a new ad method over here so we just duplicate this and we can say this is for the place features and then we can say mod Place features colon column bootstrap and now our world gen thing is completed our version here is completed we can run the data again and then a place feature will also generate in our world Trend folder and then we’re almost done we there’s a tiny tiny tiny bit that we Also need to do and then our tree will finally spawn and here we go a place feature Json file has also been created with well basically everything that we need this is exactly the Json file that we’re going to need for this so perfectly fine fine and perfectly Amazing now this will not yet spawn inside of the world because well we’ve had not added it to the world now there is a interesting thing that we need to do and that is a biome modifier so we basically need to add a biomodifier and that is well going to modify a biome This is a four specific thing so this is a data for Forge however it goes into the data folder inside of the tutorial mod folder so we need this again and then inside of there we want a forge folder and then inside of there we want a another directory called biomodifiers No mod biomodifier very important and we’re going to call this the ebony.json there you go and it’s going to look well kind of like this I’m just going to copy this over because it is fairly self-explanatory we’re going to add a feature inside of the planes biome it’s Called ebony place which is exactly this name over here it has to be the name of the key and then this is going to be in vegetal decoration now if anyone knows how I can also make a data generator for the biomodifiers I would love to know This I have Google Google and I’ve looked into the Discord and there was nothing to find so if anyone knows if there’s an easy you know relatively easy way to also generate the biomodifiers I would love to know this you can tag me on Discord or or just write me a comment That would be amazing but luckily of course the Json files over here for the biomodifiers aren’t that complicated so it shouldn’t be too bad but now after we’ve added the biomodifier over here now our tree will spawn in the world so let’s go into the game and then also Very important make a new world and let’s take a look if everything works when creating a new world you will be greeted with the experimental settings you just have to say yes and every time you join into the world you also have to say yeah I’m okay with the experimental Settings it sadly is what it is but that should be no worries at all and now let’s see if our trees are spawning inside of the world alright fast in Minecraft and we can already see our ebony leaves and Ebony logs are exactly over here so this is a very tiny planes Biome in this case well actually it continues over here that’s pretty good so there you go so well I mean exactly what we expected to so well perfect and that’s gonna be it for this tutorial right here I hope you found this useful and you learned something new and I’ll See you all in the next tutorial so yeah Video Information
This video, titled ‘Minecraft 1.19.3 – Forge Modding Tutorial: Tree Generation | #7’, was uploaded by Modding by Kaupenjoe on 2023-03-01 15:59:52. It has garnered 5703 views and 89 likes. The duration of the video is 00:28:08 or 1688 seconds.
In this Minecraft Modding Tutorial, we are adding custom Trees and Custom Tree Generation to Minecraft 1.19.3 using Forge.
== SUPPORT ME ON PATREON == ▶️ https://www.patreon.com/Kaupenjoe
== COMPATIBILITY == ▶️ Compatible with 1.19.3 and 1.19.4 ⏹️ Somewhat Compatible with 1.20.X
== ASSETS & DOWNLOAD LINKS == GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Forge-Tutorial-1.19.3/tree/7-treeGeneration Assets: https://url.kaupenjoe.net/mbkj21/assets
== TIMESTAMPS == 0:00 Introduction 1:00 Creating the Custom Blocks 13:03 Spawning the Tree from a Sapling 18:42 First Demonstration 19:20 Fixing Leaves Despawning and Other Stuff 20:53 Tree Generation for our custom Tree 27:28 Second Demonstration 28:01 Outro
== 25% OFF FOR GAMING SERVERS == ▶️ https://www.bisecthosting.com/Kaupenjoe
== 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 *
== 1 MONTH SKILLSHARE FOR FREE == ▶️ https://www.skillshare.com/r/user/kaupenjoe *
== 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 ==
== 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