How to make my entity have different behavior phases

Started by MTOH on

Topic category: Help with modding (Java Edition)

Last seen on 15:07, 1. Mar 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make my entity have different behavior phases

Hello people!

I would like to ask how I would be able to make different  behavioral phases for my horror entity. The phases individually work fine but changing between each phase and capping the amount of entities allowed to be on the world to 1 is proving to be quite hard. If it is of any help, the first phase is a weeping angel type phase  that lasts from the moment it spawns till it gets within 5 blocks of the player. Then the chase phase is activated where the mob is given speed and is not restricted by the player looking at it. Right now I am using global variables that do not work and just despawn the entity every time. Are there any better ways to make this?

Cheers!

Last seen on 07:18, 4. Mar 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To do this, I would use a…
Thu, 11/30/2023 - 21:00

To do this, I would use a variable that holds the number of the stage you want. You could make a procedure to randomly change this, or change it when the mob is close to the player. Make it so that each phase is a different mob, and that if the phase 1 mob detects that the variable is in phase 2, despawn it and spawn in phase 2. This is what works for me.