Topic category: User side tutorials
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).
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.
Next, construct the procedure like this:
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.
Hold on, the procedure isn't working, just ignore this topic until, I fix it.
Ok I fixed it, now ignore the first comment.
Thank you very much, this was really helpful!