Hello dear PaperMC-Community,
I am trying to stop a villager from panicking (when a hostile mob is nearby).
This code did nothing. It is in a method that is executed during an EntitySpawnEvent with a delay of one tick (tried 3 ticks too). I checked if memberEntity isn't right but the variable refers to the entity I target. I also tried doing it via a scheduled task every 5 ticks or so but they still panicked the entire time (not even stopped for a brief second or tick). I guess the line itself has a problem and therefore doesn't work. So I want to know what is my mistake and how can I change the targeted villager to adapt the desired behaviour.
Thank you!
I am trying to stop a villager from panicking (when a hostile mob is nearby).
Code:
Bukkit.getMobGoals().removeGoal((Villager) memberEntity, VanillaGoal.PANIC);
Thank you!