![]() |
Bukkit
1.4.7-R1.0
|
Called when a creature targets or untargets another entity. More...
Inheritance diagram for org.bukkit.event.entity.EntityTargetEvent:
Collaboration diagram for org.bukkit.event.entity.EntityTargetEvent:Classes | |
| enum | TargetReason |
| An enum to specify the reason for the targeting. More... | |
Public Member Functions | |
| EntityTargetEvent (final Entity entity, final Entity target, final TargetReason reason) | |
| boolean | isCancelled () |
| void | setCancelled (boolean cancel) |
| TargetReason | getReason () |
| Returns the reason for the targeting. | |
| Entity | getTarget () |
| Get the entity that this is targeting. | |
| void | setTarget (Entity target) |
| Set the entity that you want the mob to target instead. | |
| HandlerList | getHandlers () |
Public Member Functions inherited from org.bukkit.event.entity.EntityEvent | |
| EntityEvent (final Entity what) | |
| Entity | getEntity () |
| Returns the Entity involved in this event. | |
| EntityType | getEntityType () |
| Gets the EntityType of the Entity involved in this event. | |
Public Member Functions inherited from org.bukkit.event.Event | |
| Event () | |
| The default constructor is defined for cleaner code. | |
| Event (boolean isAsync) | |
| This constructor is used to explicitly declare an event as synchronous or asynchronous. | |
| String | getEventName () |
| final boolean | isAsynchronous () |
| Any custom event that should not by synchronized with other events must use the specific constructor. | |
Public Member Functions inherited from org.bukkit.event.Cancellable | |
| boolean | isCancelled () |
| Gets the cancellation state of this event. | |
| void | setCancelled (boolean cancel) |
| Sets the cancellation state of this event. | |
Static Public Member Functions | |
| static HandlerList | getHandlerList () |
Additional Inherited Members | |
Protected Attributes inherited from org.bukkit.event.entity.EntityEvent | |
| Entity | entity |
Called when a creature targets or untargets another entity.
Definition at line 10 of file EntityTargetEvent.java.
| org.bukkit.event.entity.EntityTargetEvent.EntityTargetEvent | ( | final Entity | entity, |
| final Entity | target, | ||
| final TargetReason | reason | ||
| ) |
Definition at line 16 of file EntityTargetEvent.java.
|
static |
Definition at line 70 of file EntityTargetEvent.java.
|
virtual |
Implements org.bukkit.event.Event.
Definition at line 66 of file EntityTargetEvent.java.
| TargetReason org.bukkit.event.entity.EntityTargetEvent.getReason | ( | ) |
Returns the reason for the targeting.
Definition at line 35 of file EntityTargetEvent.java.
| Entity org.bukkit.event.entity.EntityTargetEvent.getTarget | ( | ) |
Get the entity that this is targeting.
This will be null in the case that the event is called when the mob forgets its target.
Definition at line 46 of file EntityTargetEvent.java.
| boolean org.bukkit.event.entity.EntityTargetEvent.isCancelled | ( | ) |
Definition at line 22 of file EntityTargetEvent.java.
| void org.bukkit.event.entity.EntityTargetEvent.setCancelled | ( | boolean | cancel | ) |
Definition at line 26 of file EntityTargetEvent.java.
| void org.bukkit.event.entity.EntityTargetEvent.setTarget | ( | Entity | target | ) |
Set the entity that you want the mob to target instead.
It is possible to be null, null will cause the entity to be target-less.
This is different from cancelling the event. Cancelling the event will cause the entity to keep an original target, while setting to be null will cause the entity to be reset
| target | The entity to target |
Definition at line 61 of file EntityTargetEvent.java.