Topic category: Help with Minecraft modding (Java Edition)
Hey, I am new to using MCreator and I am trying to make a mod where after a random tick, it will change a block underneath, skipping the air block in the process.
For example, if my block is at Z 64 and there is air blocks between Z 59 to Z 63 and another block at Z 58. At a random tick, the Block at 64 will change the block at 58.
I am quite fluent in Java, so if code is needed, that is find. Just give steps to it so others may understand.
Bonus Question:
I don't want to spam topics so I will give a bonus question.
I need to make Vanilla Sheep eat a custom grass block I created. However, I can't find a way to edit the Sheep AI to do so. Unless I can use tags and assign a grass tag to my custom grass block and ot will make it where the sheep will turn it into a dirt block.
For the block changing, you'll just need to use a while block and two custom variables; a boolean, and a number. (I'll call them 'found,' and 'sy.')
For the sheep stuff, there isn't an easy way to change Vanilla AI, and there aren't any tags for grass blocks. Your best bet would probably be to make the block tick randomly and check if a sheep is directly above, if you really need this to work. However, it won't play the animation.
Thanks. You sure I can't make sheep eat my custom grass as I really need the sheep to eat my custom grass.
Even if I hard coded it. As I am quite knowledgeable in Java.