Started by
Mindthemoods
on
Topic category: Help with modding (Java Edition)
Loving the new pathfinding stuff, but one issue I've come across is a means of resetting an entity's attack target. (That is, not changing it, but rather setting it back to noone.) Attempting to set the attack target to a null entity produces a compilation error, and attempting to stop navigation temporarily stops the entity's pathfinding, but does not affect the attack target, resulting in it still moving slowly towards the source.
In short, I'm looking for a means of returning an entity to a neutral state under various conditions. Is there something I'm missing, or should I just bite the bullet and try to code this?
The current system I'm using is to simply spawn an invisible/insubstantial entity at the position of the attacker, set the attack target to the invisible entity, and then despawn the invisible entity. This works, of course, but it's hardly the most elegant solution.