make the entity follow the player

Started by КитПаланик on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make the entity follow the player

I'm making a mod. There are handcuffs in it, I want it to "put on" when I click on the villager and the villager follows me like a pig follows a player if he has a carrot in his hands. I've tried using a loop and a waiting block, but nothing works for me. Help please.

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if you handcuff the villager…
Sun, 03/01/2026 - 19:33

if you handcuff the villager, give it a synced data string that is set to the uuid of the player, on tick update you transform the uuid to an entity and try to pathfind to xyz of this entity