How To make entity stop targeting another entity

Started by Devenilla on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How To make entity stop targeting another entity

so i have an entity
and i want to set it's target to null or like remove it's target

how can i do that?
https://ibb.co/N9cXfWF

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
question your entity here is…
Wed, 12/21/2022 - 09:40

question your entity here is trying to attack who ?

so i can know what code u need t put

 

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
this entity is a pet…
Thu, 12/22/2022 - 07:48

this entity is a pet detecting any entity in a radius trying to attack me
sometimes the condition just doesn't work and i tried every way from foreach entity iterator to get nearest entity to while loops
they all have the same problem
sometimes there is another pet or another entity that is not attacking filling the pet's target


and i want to set the target entity of the pet to null

if i was able to do that, i have basically solved my problem

is there anyway (requires code or not) i can set the target of an entity to null