Package org.bukkit.event.entity
Enum Class EntityTargetEvent.TargetReason
java.lang.Object
java.lang.Enum<EntityTargetEvent.TargetReason>
org.bukkit.event.entity.EntityTargetEvent.TargetReason
- All Implemented Interfaces:
- Serializable,- Comparable<EntityTargetEvent.TargetReason>,- Constable
- Enclosing class:
- EntityTargetEvent
An enum to specify the reason for the targeting
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionWhen the entity doesn't have a target, so it attacks the nearest entityWhen the entity doesn't have a target, so it attacks the nearest playerWhen an entity targets another entity after colliding with it.For custom calls to the event.When an entity selects a target while defending a village.When a raiding entity selects the same target as one of its compatriots.When the target is forgotten for whatever reason.When the owner of the entity attacks the target attacks, so the entity targets it.Deprecated.When the entity has no target, so the entity randomly chooses one.When a zombie targeting an entity summons reinforcements, so the reinforcements target the same entityWhen the target attacks the entity, so entity targets itWhen the target attacks a nearby entity of the same type, so the entity targets itWhen the target attacks the owner of the entity, so the entity targets it.When the entity's target has died, and so it no longer targets itWhen another entity tempts this entity by having a desired item such as wheat in it's hand.A currently unknown reason for the entity changing target.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static EntityTargetEvent.TargetReason[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
TARGET_DIEDWhen the entity's target has died, and so it no longer targets it
- 
CLOSEST_PLAYERWhen the entity doesn't have a target, so it attacks the nearest player
- 
TARGET_ATTACKED_ENTITYWhen the target attacks the entity, so entity targets it
- 
PIG_ZOMBIE_TARGETDeprecated.obsoleted byTARGET_ATTACKED_NEARBY_ENTITYWhen the target attacks a fellow pig zombie, so the whole group will target him with this reason.
- 
FORGOT_TARGETWhen the target is forgotten for whatever reason.
- 
TARGET_ATTACKED_OWNERWhen the target attacks the owner of the entity, so the entity targets it.
- 
OWNER_ATTACKED_TARGETWhen the owner of the entity attacks the target attacks, so the entity targets it.
- 
RANDOM_TARGETWhen the entity has no target, so the entity randomly chooses one.
- 
DEFEND_VILLAGEWhen an entity selects a target while defending a village.
- 
TARGET_ATTACKED_NEARBY_ENTITYWhen the target attacks a nearby entity of the same type, so the entity targets it
- 
REINFORCEMENT_TARGETWhen a zombie targeting an entity summons reinforcements, so the reinforcements target the same entity
- 
COLLISIONWhen an entity targets another entity after colliding with it.
- 
CUSTOMFor custom calls to the event.
- 
CLOSEST_ENTITYWhen the entity doesn't have a target, so it attacks the nearest entity
- 
FOLLOW_LEADERWhen a raiding entity selects the same target as one of its compatriots.
- 
TEMPTWhen another entity tempts this entity by having a desired item such as wheat in it's hand.
- 
UNKNOWNA currently unknown reason for the entity changing target.
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
 
- 
TARGET_ATTACKED_NEARBY_ENTITY