How to make working saplings (TUTORIAL)

Started by Eonaut on

Topic category: User side tutorials

Last seen on 23:44, 18. Aug 2019
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make working saplings (TUTORIAL)
Fri, 07/27/2018 - 00:20 (edited)

I finally figured out how to get saplings to work- just in time for the event system to change in MCreator. If you know how to represent events in the new sequence form, or if you're using old versions of MCreator, then this will work for you.

These steps will only make a sapling grow when you click on it with bonemeal (although technically, any dye will work, so you can grow trees with ink sacs or lapis lazuli if you really wanted) I am not sure how to make them grow naturally after a time span of more than 10 ticks. I tried it before and the sapling grew as soon as it was placed on dirt.

1- Make a tree schematic with MCedit.

2- Make a plant or block for the sapling and go to events.

3-  under events, choose "when right clicked on block"

4- add a stack event with the condition "item in player's hand = dye"

5- under your stack event, add two more events:

          5.1-consume item from inventory -->" item to consume=dye" with the condition (in all cases)

          5.2- stack event with two event:

                    5.2.1-place schematic with the condition Random possibility= [9.15]%

                    5.2.2- add block at i, j, k = [whatever block your tree's trunk is made of]

6- Now go into the test environment and try growing the sapling. It will take a few times like a normal sapling, but when it grows, it will place the tree somewhere in the +x +z direction away from the sapling. Count how many blocks in X and Z the base of the trunk is from the sapling, with the block the sapling is on counting as 1.

7- Edit (with locking) the code of the sapling and scroll to the bottom. You should see a lot of lines of code like this:

world.setBlockState(new BlockPos(i + 3, j + 0, k + 1), Block.getBlockById(97).getStateFromMeta(8), 3);

8- If your schematic is supposed to use modded blocks, you need to edit every section of "getBlockById(#)" . Kane has a good tutorial on how to do this HERE.

9- Edit every section of "new BlockPos(i+#, j+#, k+#)" to align the tree with the sapling. For example, if my tree schematic generated 3 blocks away in X and 2 in Z, the example code above would change to

orld.setBlockState(new BlockPos(i + 0, j + 0, k - 1), Block.getBlockById(97).getStateFromMeta(8), 3);

NOTE: All of my schematics so far have generated  +X +Z away from the sapling, but I don't know if it does this 100% of the time, so double check the direction when you measure your schematic in step 6. 

10- Hit "Save and build" to save the code and test the sapling in minecraft.

 

Edited by Eonaut on Fri, 07/27/2018 - 00:20
Last seen on 18:58, 4. Jun 2021
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
does this work for mcreator…
Thu, 11/22/2018 - 23:10

does this work for mcreator.1.8.1?? (for MC1.12.2?)

Yes, but the process is a…
Fri, 11/23/2018 - 15:08

Yes, but the process is a bit different now. I believe I just saw a tutorial for this a few days ago for newer procedure supported versions of MCreator. Just try to search for it using the search bar and you should find some good tutorials.

Last seen on 18:58, 4. Jun 2021
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thanks I will search
Fri, 11/23/2018 - 16:04

thanks I will search

Last seen on 18:58, 4. Jun 2021
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey I dont Find the tutorial…
Fri, 11/23/2018 - 16:23

Hey I dont Find the tutorial you tell me can you pass me the link plis?

These might help: https:/…
Fri, 11/23/2018 - 16:50

These might help:

I thought I saw an actual procedure based tutorial, but it seems I was wrong. I think this tutorial should work with 1.8.1 too, you just need to find the appropriate procedure blocks.

Last seen on 18:58, 4. Jun 2021
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok thank you very much I…
Fri, 11/23/2018 - 17:33

ok thank you very much I will see what I can do

Last seen on 03:58, 26. Sep 2023
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know it's two years later…
Fri, 07/09/2021 - 01:35

I know it's two years later lol, but is this still a thing 

"item in player's hand = dye"

I doubt it but I can't find anything else as of right now