Commits

GJ authored and Travis Watkins committed ed67385edf1
[Bleeding] Add new TargetReasons to EntityTargetEvent.

This commit adds three new TargetReasons to EntityTargetEvent to address missing cases where the event is not currently fired. The first, TargetReason.TARGET_ATTACKED_NEARBY_ENTITY, is used when a neutral wolf is attacked, causing all nearby wolves to turn hostile and attack the first wolf's target. The second, TargetReason.REINFORCEMENT_TARGET, is used when a zombie summons reinforcements and the new zombie targets the first zombie's target. The third, TargetReason.COLLISION, is used when an iron golem collides with a hostile entity, causing it to begin targeting the entity it collided with.
No tags

src/main/java/org/bukkit/event/entity/EntityTargetEvent.java

Modified
114 114 */
115 115 OWNER_ATTACKED_TARGET,
116 116 /**
117 117 * When the entity has no target, so the entity randomly chooses one.
118 118 */
119 119 RANDOM_TARGET,
120 120 /**
121 121 * When an entity selects a target while defending a village.
122 122 */
123 123 DEFEND_VILLAGE,
124 + /**
125 + * When the target attacks a nearby entity of the same type, so the entity targets it
126 + */
127 + TARGET_ATTACKED_NEARBY_ENTITY,
128 + /**
129 + * When a zombie targeting an entity summons reinforcements, so the reinforcements target the same entity
130 + */
131 + REINFORCEMENT_TARGET,
132 + /**
133 + * When an entity targets another entity after colliding with it.
134 + */
135 + COLLISION,
124 136 /**
125 137 * For custom calls to the event.
126 138 */
127 139 CUSTOM
128 140 }
129 141 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut