| Name | entity targets entity because cause |
| Event Lines | <entity> targets (<entity>) (because <cause>) |
| Triggers | when an entity targets a new entity (usually a hostile mob preparing to attack something), or un-targets one. |
| Generated Examples | after skeleton_horse targets:
after shulker_bullet targets: |
| Has Player | when the entity being targetted is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
| Contexts | <context.entity> returns the targeting entity.
<context.reason> returns the reason the entity changed targets. Refer to https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityTargetEvent.TargetReason.html.
<context.target> returns the targeted entity, if any.
|
| Determine | EntityTag to make the entity target a different entity instead. |
| Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
| Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
| Group | Entity |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityTargetsScriptEvent.java#L16 |