How to make entity stay behind player

Started by Sky_PC on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make entity stay behind player

So, I'm making a mod, and I need a specific entity to spawn when a key is pressed while the player is holding an item.When spawned, it should stay behind the player. I also need it to move in front of the player when a specific key is pressed, and disappear when another key is pressed.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not sure if this would…
Wed, 07/26/2023 - 15:30

Use direction of blocks for each cardinal direction to always stay behind the player.

I'm not sure if this would work but it'd be a good start.

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I feel like that would work…
Fri, 07/28/2023 - 07:03

I feel like that would work absolutely perfect, but im not sure where to put the code. Currently, i have it so that when you use an item, it spawns an entity. would i have to put that on an entity trigger?