Anyone had issues with making an entity deselect a target from minecraft:behavior.owner_hurt_target? I have a custom entity that protects its owner. It uses the minecraft:behavior.owner_hurt_target behavior. Once the owner hits anything, the entity completely focus on that target. It doesn't even reselect the target when the owner hits a new entity and it doesn't forget the target when the it is moved hundreds of blocks away.
Things I tried so far:
- Providing alternative target via
minecraft:behavior.nearest_prioritized_attackable_target. It works until the alternative target is dead. After that the entity returns to targeting the entitty attacked by owner. - Removing all existing targeting components from the entity for a moment (longer than 1 tick)
- Removing attack ability for a moment (longer than 1 tick)
- Using the entity_types in the
minecraft:behavior.owner_hurt_targetwithreevaluate_descriptionset to true, and making the target invalid by giving it a special/tagexcluded in the filters. - Using
must_see_forget_durationinentity_typesmentioned above.
Reloading the game works when the target is far away.
It's also worth mentioning that the wolf behvior lets the wolf forget its target, but I wasn't able to identify the components that enable this behavior.