Started by
AOCAWOL
on
Topic category: Help with Minecraft modding (Java Edition)
So I've been getting a lot of requests for my grass blocks to be Bonemeal-able. Any way to do this?
I also got a request to make my grass blocks spreadable. I've looked around but I couldn't find anything.
You can use a global trigger when bonemeal used. The coordinates you get are coordinates of the block clicked. Check if this block is your grass and if it is, randomly spawns some more grass blocks around, for the example of grass.
Example of how to use trigger for bonemeal was shown on our twitter recently: https://twitter.com/PyloDEV/status/1153236669799313413/photo/1 (might help for the starting point)
I don't really know how to spawn random blocks in a radius. And how would I make it so it doesn't accidentally spawn grass in something like if I bonemeal grass next to my house and then the grass just deletes my walls and replaces it with grass.?
To spawn blocks around one location, use random procedure and add random values between say -5 and 5 to x and z coordinates. One way to make sure you can spawn them is to check if the block at the location of spawning is air.
For spreading grass, there is a way using procedures, but it is incredibly laggy and can cause entities to freeze.
Basically you just have a procedure for block tick update detecting if your dirt block is on a block next to (but not directly above or below) the grass block. It then has a random chance to spread to one of these blocks.
I wouldn't recommend using it though.