How to play an animation if player is too close to entity

Started by d.rewpy on

Topic category: Help with modding (Java Edition)

Last seen on 01:14, 20. Nov 2023
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to play an animation if player is too close to entity

I am making a rattlesnake that I want to "rattle" its tail if the player is too close to it(around 2-4 blocks away), and then attack if the player gets closer or doesn't move away.

Currently I figured out how to play the animation but it just keep looping and doesn't stop nor does it trigger with the player is close. I am very amateur at coding but this is what I've gotten down at the moment.   -->