Started by
Hello_There
on
Topic category: Help with Minecraft modding (Java Edition)
Hey, so, I can't figure out how to make tree saplings that grow and was hoping someone here could help.
Topic category: Help with Minecraft modding (Java Edition)
Hey, so, I can't figure out how to make tree saplings that grow and was hoping someone here could help.
Go to mcreator and create a plant
In MCreator, create a new plant. Add in all the different variables of your desired sapling.
Then make sure to apply "Force Ticking" box, as this will set the sapling to tick randomly. Go to the procedures, and choose the "Update Tick" one, then add in a new procedure that will remove the sapling, and will place the structure instead (You can search for the procedures in the search tab in MCreator's procedure window).
For the bonemeal, simply add a "Upon right click" procedure, then add in a block that checks for the bonemeal in either the main hand or the offhand of the player. (use a "OR" block here), then add a block that also removes the block and replaces it with a the tree structure you made. (If you want the tree to not grow instantly, simply do add a random variable from the template of procedures (Do with 70% chance) and attach it to your main block. You can fiddle with the chance the way you see fit.)
Lastly, for the finer details, add in a new block to the "Upon Right Click" procedure, where it spawns the "VILLAGER_HAPPY" particles (same ones used for bonemeal when applied) around the sapling when right clicked with a bonemeal.
That should be it.
Things to note, make sure that your tree structure has the air blocks replaced with structure void. Otherwise it will replace any blocks that used to occupy the place where the air blocks now occupy.
If you need anything else, feel free to let me know!
Thanks, that helped a lot! The tree spawns a few blocks away from the sapling though and was wondering if you knew how to fix that.
Well, maybe you could adjust your x and z coordinates and see which adjustment actually works in the procedure (for example: x+2, z-3 etc)
How would I do that?
just change the procedure!
Simply in the place structure procedure, change the X, and the Z to numbers that correlate to your structure. Add in a [ ] + [ ] block from the math procedures, and add in the X in either of the boxes of the math block, then, once again in math, grab the number block, and add it to the other box of the main math block. (So it would look something like this: [X] + [Your Number Here].
To find out what numbers to add, simply count how many blocks in both the X and the Z axis respectively your center block of the structure (tree) away from the structure block.
That should be it.