Package org.bukkit.event.entity
Enum 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
public static enum EntityTargetEvent.TargetReason extends Enum<EntityTargetEvent.TargetReason>
An enum to specify the reason for the targeting
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description CLOSEST_ENTITY
When the entity doesn't have a target, so it attacks the nearest entityCLOSEST_PLAYER
When the entity doesn't have a target, so it attacks the nearest playerCOLLISION
When an entity targets another entity after colliding with it.CUSTOM
For custom calls to the event.DEFEND_VILLAGE
When an entity selects a target while defending a village.FOLLOW_LEADER
When a raiding entity selects the same target as one of its compatriots.FORGOT_TARGET
When the target is forgotten for whatever reason.OWNER_ATTACKED_TARGET
When the owner of the entity attacks the target attacks, so the entity targets it.PIG_ZOMBIE_TARGET
Deprecated.obsoleted byTARGET_ATTACKED_NEARBY_ENTITY
RANDOM_TARGET
When the entity has no target, so the entity randomly chooses one.REINFORCEMENT_TARGET
When a zombie targeting an entity summons reinforcements, so the reinforcements target the same entityTARGET_ATTACKED_ENTITY
When the target attacks the entity, so entity targets itTARGET_ATTACKED_NEARBY_ENTITY
When the target attacks a nearby entity of the same type, so the entity targets itTARGET_ATTACKED_OWNER
When the target attacks the owner of the entity, so the entity targets it.TARGET_DIED
When the entity's target has died, and so it no longer targets itTEMPT
When another entity tempts this entity by having a desired item such as wheat in it's hand.UNKNOWN
A currently unknown reason for the entity changing target. -
Method Summary
Modifier and Type Method Description static EntityTargetEvent.TargetReason
valueOf(String name)
Returns the enum constant of this type with the specified name.static EntityTargetEvent.TargetReason[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
TARGET_DIED
When the entity's target has died, and so it no longer targets it -
CLOSEST_PLAYER
When the entity doesn't have a target, so it attacks the nearest player -
TARGET_ATTACKED_ENTITY
When the target attacks the entity, so entity targets it -
PIG_ZOMBIE_TARGET
Deprecated.obsoleted byTARGET_ATTACKED_NEARBY_ENTITY
When the target attacks a fellow pig zombie, so the whole group will target him with this reason. -
FORGOT_TARGET
When the target is forgotten for whatever reason. -
TARGET_ATTACKED_OWNER
When the target attacks the owner of the entity, so the entity targets it. -
OWNER_ATTACKED_TARGET
When the owner of the entity attacks the target attacks, so the entity targets it. -
RANDOM_TARGET
When the entity has no target, so the entity randomly chooses one. -
DEFEND_VILLAGE
When an entity selects a target while defending a village. -
TARGET_ATTACKED_NEARBY_ENTITY
When the target attacks a nearby entity of the same type, so the entity targets it -
REINFORCEMENT_TARGET
When a zombie targeting an entity summons reinforcements, so the reinforcements target the same entity -
COLLISION
When an entity targets another entity after colliding with it. -
CUSTOM
For custom calls to the event. -
CLOSEST_ENTITY
When the entity doesn't have a target, so it attacks the nearest entity -
FOLLOW_LEADER
When a raiding entity selects the same target as one of its compatriots. -
TEMPT
When another entity tempts this entity by having a desired item such as wheat in it's hand. -
UNKNOWN
A currently unknown reason for the entity changing target.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-