1. Wiki
  2. /Entities
  3. /minecraft:on_target_acquired

minecraft:on_target_acquired

Don't want to write this by hand? GodCraft sets minecraft:on_target_acquired for you with a switch.Get GodCraft

Overview

minecraft:on_target_acquired is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Runs an event when this entity picks a new target, for example to switch to an angry look.

Fields

FieldTypeDefaultDescription
eventstring""Name of the event to run.
targetFilterSubject"self"Who the event runs on, for example self or other.
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Conditions that must be true for the event to run.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:on_target_acquired": {
    "event": "",
    "target": "self",
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    }
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more