org.bukkit.event.entity
Enum EntityTargetEvent.TargetReason

java.lang.Object
  extended by java.lang.Enum<EntityTargetEvent.TargetReason>
      extended by org.bukkit.event.entity.EntityTargetEvent.TargetReason
All Implemented Interfaces:
Serializable, Comparable<EntityTargetEvent.TargetReason>
Enclosing class:
EntityTargetEvent

public static enum EntityTargetEvent.TargetReason
extends Enum<EntityTargetEvent.TargetReason>

An enum to specify the reason for the targeting


Enum Constant Summary
CLOSEST_PLAYER
          When the entity doesn't have a target, so it attacks the nearest player
CUSTOM
          For custom calls to the event
DEFEND_VILLAGE
          When an entity selects a target while defending a village.
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
          When the target attacks a fellow pig zombie, so the whole group will target him with this reason.
RANDOM_TARGET
          When the entity has no target, so the entity randomly chooses one.
TARGET_ATTACKED_ENTITY
          When the target attacks the entity, so entity targets it
TARGET_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 it
 
Method Summary
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're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TARGET_DIED

public static final EntityTargetEvent.TargetReason TARGET_DIED
When the entity's target has died, and so it no longer targets it


CLOSEST_PLAYER

public static final EntityTargetEvent.TargetReason CLOSEST_PLAYER
When the entity doesn't have a target, so it attacks the nearest player


TARGET_ATTACKED_ENTITY

public static final EntityTargetEvent.TargetReason TARGET_ATTACKED_ENTITY
When the target attacks the entity, so entity targets it


PIG_ZOMBIE_TARGET

public static final EntityTargetEvent.TargetReason PIG_ZOMBIE_TARGET
When the target attacks a fellow pig zombie, so the whole group will target him with this reason.


FORGOT_TARGET

public static final EntityTargetEvent.TargetReason FORGOT_TARGET
When the target is forgotten for whatever reason. Currently only occurs in with spiders when there is a high brightness


TARGET_ATTACKED_OWNER

public static final EntityTargetEvent.TargetReason TARGET_ATTACKED_OWNER
When the target attacks the owner of the entity, so the entity targets it.


OWNER_ATTACKED_TARGET

public static final EntityTargetEvent.TargetReason OWNER_ATTACKED_TARGET
When the owner of the entity attacks the target attacks, so the entity targets it.


RANDOM_TARGET

public static final EntityTargetEvent.TargetReason RANDOM_TARGET
When the entity has no target, so the entity randomly chooses one.


DEFEND_VILLAGE

public static final EntityTargetEvent.TargetReason DEFEND_VILLAGE
When an entity selects a target while defending a village.


CUSTOM

public static final EntityTargetEvent.TargetReason CUSTOM
For custom calls to the event

Method Detail

values

public static final EntityTargetEvent.TargetReason[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(EntityTargetEvent.TargetReason c : EntityTargetEvent.TargetReason.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static EntityTargetEvent.TargetReason valueOf(String name)
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 name


Copyright © 2013. All Rights Reserved.