How to make player stare at the entity

Started by Valikk on

Topic category: Help with MCreator software

Joined Apr 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make player stare at the entity

So, I'm making a horror mod, and I have an entity that spawns at night. What I want to do is: when the entity spawns, it forces the player to look at it for a few seconds, and only then lets the player move their camera away. That seems simple enough, but I CAN'T FIGURE OUT HOW TO MAKE THE PLAYER LOOK AT THE ENTITY. I've searched everywhere, but I haven't found any tutorials that explain how to do this. I'm still a beginner, so visual help like images or screenshots of the procedures or node setups would be really helpful.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You need to constantly set…
Sat, 05/09/2026 - 09:43

You need to constantly set the players look direction to the angle between the players x y z and the entity's x y z. You have to calculate the angle between the two points and set the look direction to that angle, between the x and z. And set the pitch to the angle between the y.

You use some type of variable to check whether the players camera should be locked in place. Then run the stare procedure on player tick update. Use on the entity spawns, then use entity iterator to check for any entity in a 10 block area or so, if entity is type player, set logic variable to true and also set a number variable to a countdown number (a few seconds = 5 seconds, 5*20=100 ticks) set it to 100.

On player tick update, if logic variable is true, do staring procedure above and -1 from the countdown number variable. When countdown number variable = 0, set logic variable to false.

Joined Apr 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
can you send a screenshot of…
Sat, 05/09/2026 - 13:07

can you send a screenshot of the procedure or maybe some youtube tutorial?

 

Joined Apr 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
nvm i got it, it works, tysm
Fri, 05/15/2026 - 08:13

nvm i got it, it works, tysm