Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.entity.EntityTargetEvent Class Reference
Inheritance diagram for org.bukkit.event.entity.EntityTargetEvent:
org.bukkit.event.entity.EntityEvent org.bukkit.event.Cancellable org.bukkit.event.Event org.bukkit.event.entity.EntityTargetLivingEntityEvent

Classes

enum  TargetReason
 

Public Member Functions

 EntityTargetEvent (final Entity entity, final Entity target, final TargetReason reason)
 
boolean isCancelled ()
 
void setCancelled (boolean cancel)
 
TargetReason getReason ()
 
Entity getTarget ()
 
void setTarget (Entity target)
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.entity.EntityEvent
 EntityEvent (final Entity what)
 
Entity getEntity ()
 
EntityType getEntityType ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

Static Public Member Functions

static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.entity.EntityEvent
Entity entity
 

Detailed Description

Called when a creature targets or untargets another entity

Definition at line 10 of file EntityTargetEvent.java.

Member Function Documentation

TargetReason org.bukkit.event.entity.EntityTargetEvent.getReason ( )

Returns the reason for the targeting

Returns
The reason

Definition at line 35 of file EntityTargetEvent.java.

35  {
36  return reason;
37  }
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.

Returns
The entity

Definition at line 47 of file EntityTargetEvent.java.

47  {
48  return target;
49  }
boolean org.bukkit.event.entity.EntityTargetEvent.isCancelled ( )

Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Returns
true if this event is cancelled

Implements org.bukkit.event.Cancellable.

Definition at line 22 of file EntityTargetEvent.java.

22  {
23  return cancel;
24  }
void org.bukkit.event.entity.EntityTargetEvent.setCancelled ( boolean  cancel)

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters
canceltrue if you wish to cancel this event

Implements org.bukkit.event.Cancellable.

Definition at line 26 of file EntityTargetEvent.java.

26  {
27  this.cancel = cancel;
28  }
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.

Parameters
targetThe entity to target

Definition at line 63 of file EntityTargetEvent.java.

63  {
64  this.target = target;
65  }

The documentation for this class was generated from the following file: