Started by
Minecraft_guy881
on
Topic category: Help with Minecraft modding (Java Edition)
I need help by making a mob/entity go walk to another mob/entity/block when a player walks or collides on it
I have ZERO coding experience so that won't be any help
There's a new 'Attempt to make entity pathfind to x/y/z' function that should work just fine for this, if you replace x/y/z with the positions of the target entity. However, (speaking from personal experience and several days of messing around with this), the pathfinding isn't always the greatest, and isn't precise down to the block. However, for most purposes, should work fine, it's in the 'entity management' tab at the bottom.
I found the part, but I'm not sure how to set it up, could you send a screenshot of how you did it?
It's really pretty straightforward: you tell the entity the coordinates to go to, and it attempts to go there. In this case, you would set the coordinates to the position of the entity you want it to go to. (You can find 'entity position' in the entity data tab.) It could look something like this:
You'll need to be running this constantly though, (on entity tick), since the target entity will likely be moving.
I tried this and it just crashes
You forgot the if block that checks if there is a certain entity type nearby