Started by
dbckswjs(cyc0706)
on
Topic category: Help with Minecraft modding (Java Edition)
I'd like to add a feature to my mod that changes mob behavior based on the height of the ground beneath them. How do I do this?
Topic category: Help with Minecraft modding (Java Edition)
I'd like to add a feature to my mod that changes mob behavior based on the height of the ground beneath them. How do I do this?
Hi,
this code snippet should be able to measure the distance between an entity and the ground. I did not test it but I think this might work. Be careful with putting it into a tick procedure (On entity tick or sth like that) bc idk how it will behave. Also, I have no clue if the failsafe (the "break out of loop" thingy) is really necessary but I thought it might be a good idea. If you need an exact measurement you can also delete the "round" block for the output but this might give you too many decimal places so I recommend using it anyways.
For your purpose, you might have to change it here and there but I do hope I could help you with this.
https://imgur.com/a/etf1kNK