*TUTORIAL* How to make custom grass die when below another block.

Started by Wooliestplate89 on

Topic category: User side tutorials

Last seen on 05:39, 5. Jan 2023
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
*TUTORIAL* How to make custom grass die when below another block.
Wed, 12/21/2022 - 05:32 (edited)

If you're reading this, you probably made a custom grass block for your mod, but then you found out it doesn't die (turn into dirt) when below another block, like vanilla grass, and you just keep getting bothered by the feeling of unpolish.

To fix this, first go the the "Advanced Properties" section of your custom block, and enable the "Tick Randomly" property (NOTE: Enabling this option will cause the game to ignore your "Tick Rate" value)

The "Tick Randomly" property in "Advanced block properties". In the "Advanced Properties" section.

 

Then go to the "Triggers" section, and select the plus icon in the "Update Tick" trigger. This will create the procedure that we will use to make our custom grass die when below a block. 

The "Update Tick" trigger in the grass block's "Triggers" section.

Next, construct the procedure like this:

if is block at x: x, y: y + 1, z: z, solid: if Random [0,1) < #Insert float value between 0 & 1: Replace block at x: x, y: y, z: z, keep state #true or false, keep NBT/inventory #true or false

You will need to replace the Deepslate block in the picture with the block you want your grass to turn into,

You can also change "0.7" to any float value between 0 and 1, the higher the value, the higher the chance of the grass block dying (I recommend keeping this value high, like 0.7 high).

The "Keep State" and the "Keep NBT/Inventory" options are up to you.

You can also extend this procedure to allow your grass block to spread, but I won't show it here (just a fancy way of saying "I'm lazy").

 

Finally, save the procedure and your grass block to keep the changes, now you can sleep well, knowing that your mod has a bit more polish.

Edited by Wooliestplate89 on Wed, 12/21/2022 - 05:32
Last seen on 05:39, 5. Jan 2023
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hold on, the procedure isn't…
Wed, 12/21/2022 - 05:08

Hold on, the procedure isn't working, just ignore this topic until, I fix it.

Last seen on 05:39, 5. Jan 2023
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok I fixed it, now ignore…
Wed, 12/21/2022 - 05:16

Ok I fixed it, now ignore the first comment.

Last seen on 09:04, 10. Jul 2023
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much, this…
Mon, 07/10/2023 - 01:28

Thank you very much, this was really helpful!