Started by
AgPixie
on
Topic category: Help with Minecraft modding (Java Edition)
I'm making an entity and I'm not sure how to make it teleport slightly closer to the player not to where it teleports ON the player, just near the player, then if the player doesn't move away from the entity it WILL teleport on the player and kill them. I'm making an SCP-173 entity
Please someone help me with this. I'd very much appreciate it.
In general, a good way of doing this is getting the average (or weighted average) of your entity's position and the player's position.
Something like:
set X to ( ( ( player X * 2 ) + ( entity X * 3 ) ) / 5 )
(then same with Y and Z)
would teleport the entity 2/5 of the way to the player.
Thank you for replying. Where do I put the code, in the Entity's AI page or do I create a procedure?
Also could you give a more specific line of code?
Thank you