Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.entity.Entity Interface Referenceabstract

Represents a base entity in the world. More...

+ Inheritance diagram for org.bukkit.entity.Entity:
+ Collaboration diagram for org.bukkit.entity.Entity:

Public Member Functions

Location getLocation ()
 Gets the entity's current position.
 
Location getLocation (Location loc)
 Stores the entity's current position in the provided Location object.
 
void setVelocity (Vector velocity)
 Sets this entity's velocity.
 
Vector getVelocity ()
 Gets this entity's current velocity.
 
World getWorld ()
 Gets the current world this entity resides in.
 
boolean teleport (Location location)
 Teleports this entity to the given location.
 
boolean teleport (Location location, TeleportCause cause)
 Teleports this entity to the given location.
 
boolean teleport (Entity destination)
 Teleports this entity to the target Entity.
 
boolean teleport (Entity destination, TeleportCause cause)
 Teleports this entity to the target Entity.
 
List< org.bukkit.entity.EntitygetNearbyEntities (double x, double y, double z)
 Returns a list of entities within a bounding box centered around this entity.
 
int getEntityId ()
 Returns a unique id for this entity.
 
int getFireTicks ()
 Returns the entity's current fire ticks (ticks before the entity stops being on fire).
 
int getMaxFireTicks ()
 Returns the entity's maximum fire ticks.
 
void setFireTicks (int ticks)
 Sets the entity's current fire ticks (ticks before the entity stops being on fire).
 
void remove ()
 Mark the entity's removal.
 
boolean isDead ()
 Returns true if this entity has been marked for removal.
 
boolean isValid ()
 Returns false if the entity has died or been despawned for some other reason.
 
Server getServer ()
 Gets the Server that contains this Entity.
 
abstract Entity getPassenger ()
 Gets the primary passenger of a vehicle.
 
abstract boolean setPassenger (Entity passenger)
 Set the passenger of a vehicle.
 
abstract boolean isEmpty ()
 Check if a vehicle has passengers.
 
abstract boolean eject ()
 Eject any passenger.
 
float getFallDistance ()
 Returns the distance this entity has fallen.
 
void setFallDistance (float distance)
 Sets the fall distance for this entity.
 
void setLastDamageCause (EntityDamageEvent event)
 Record the last EntityDamageEvent inflicted on this entity.
 
EntityDamageEvent getLastDamageCause ()
 Retrieve the last EntityDamageEvent inflicted on this entity.
 
UUID getUniqueId ()
 Returns a unique and persistent id for this entity.
 
int getTicksLived ()
 Gets the amount of ticks this entity has lived for.
 
void setTicksLived (int value)
 Sets the amount of ticks this entity has lived for.
 
void playEffect (EntityEffect type)
 Performs the specified EntityEffect for this entity.
 
EntityType getType ()
 Get the type of the entity.
 
boolean isInsideVehicle ()
 Returns whether this entity is inside a vehicle.
 
boolean leaveVehicle ()
 Leave the current vehicle.
 
Entity getVehicle ()
 Get the vehicle that this player is inside.
 

Detailed Description

Represents a base entity in the world.

Definition at line 18 of file Entity.java.

Member Function Documentation

abstract boolean org.bukkit.entity.Entity.eject ( )
pure virtual

Eject any passenger.

Returns
True if there was a passenger.
int org.bukkit.entity.Entity.getEntityId ( )

Returns a unique id for this entity.

Returns
Entity id
float org.bukkit.entity.Entity.getFallDistance ( )

Returns the distance this entity has fallen.

Returns
The distance.
int org.bukkit.entity.Entity.getFireTicks ( )

Returns the entity's current fire ticks (ticks before the entity stops being on fire).

Returns
int fireTicks
EntityDamageEvent org.bukkit.entity.Entity.getLastDamageCause ( )

Retrieve the last EntityDamageEvent inflicted on this entity.

This event may have been cancelled.

Returns
the last known EntityDamageEvent or null if hitherto unharmed
Location org.bukkit.entity.Entity.getLocation ( )
Location org.bukkit.entity.Entity.getLocation ( Location  loc)

Stores the entity's current position in the provided Location object.


If the provided Location is null this method does nothing and returns null.

Returns
The Location object provided or null
int org.bukkit.entity.Entity.getMaxFireTicks ( )

Returns the entity's maximum fire ticks.

Returns
int maxFireTicks
List<org.bukkit.entity.Entity> org.bukkit.entity.Entity.getNearbyEntities ( double  x,
double  y,
double  z 
)

Returns a list of entities within a bounding box centered around this entity.

Parameters
x1/2 the size of the box along x axis
y1/2 the size of the box along y axis
z1/2 the size of the box along z axis
Returns
List<Entity> List of entities nearby
abstract Entity org.bukkit.entity.Entity.getPassenger ( )
pure virtual

Gets the primary passenger of a vehicle.

For vehicles that could have multiple passengers, this will only return the primary passenger.

Returns
an entity
Server org.bukkit.entity.Entity.getServer ( )

Gets the Server that contains this Entity.

Returns
Server instance running this Entity
int org.bukkit.entity.Entity.getTicksLived ( )

Gets the amount of ticks this entity has lived for.

This is the equivalent to "age" in entities.

Returns
Age of entity
EntityType org.bukkit.entity.Entity.getType ( )

Get the type of the entity.

Returns
The entity type.

Referenced by org.bukkit.event.entity.EntityEvent.getEntityType().

UUID org.bukkit.entity.Entity.getUniqueId ( )

Returns a unique and persistent id for this entity.

Returns
unique id
Entity org.bukkit.entity.Entity.getVehicle ( )

Get the vehicle that this player is inside.

If there is no vehicle, null will be returned.

Returns
The current vehicle.
Vector org.bukkit.entity.Entity.getVelocity ( )

Gets this entity's current velocity.

Returns
Current travelling velocity of this entity
World org.bukkit.entity.Entity.getWorld ( )
boolean org.bukkit.entity.Entity.isDead ( )

Returns true if this entity has been marked for removal.

Returns
True if it is dead.
abstract boolean org.bukkit.entity.Entity.isEmpty ( )
pure virtual

Check if a vehicle has passengers.

Returns
True if the vehicle has no passengers.
boolean org.bukkit.entity.Entity.isInsideVehicle ( )

Returns whether this entity is inside a vehicle.

Returns
True if the entity is in a vehicle.
boolean org.bukkit.entity.Entity.isValid ( )

Returns false if the entity has died or been despawned for some other reason.

Returns
True if valid.
boolean org.bukkit.entity.Entity.leaveVehicle ( )

Leave the current vehicle.

If the entity is currently in a vehicle (and is removed from it), true will be returned, otherwise false will be returned.

Returns
True if the entity was in a vehicle.
void org.bukkit.entity.Entity.playEffect ( EntityEffect  type)

Performs the specified EntityEffect for this entity.

This will be viewable to all players near the entity.

Parameters
typeEffect to play.
void org.bukkit.entity.Entity.remove ( )

Mark the entity's removal.

void org.bukkit.entity.Entity.setFallDistance ( float  distance)

Sets the fall distance for this entity.

Parameters
distanceThe new distance.
void org.bukkit.entity.Entity.setFireTicks ( int  ticks)

Sets the entity's current fire ticks (ticks before the entity stops being on fire).

Parameters
ticksCurrent ticks remaining
void org.bukkit.entity.Entity.setLastDamageCause ( EntityDamageEvent  event)

Record the last EntityDamageEvent inflicted on this entity.

Parameters
eventa EntityDamageEvent

Referenced by org.bukkit.command.defaults.KillCommand.execute().

abstract boolean org.bukkit.entity.Entity.setPassenger ( Entity  passenger)
pure virtual

Set the passenger of a vehicle.

Parameters
passengerThe new passenger.
Returns
false if it could not be done for whatever reason
void org.bukkit.entity.Entity.setTicksLived ( int  value)

Sets the amount of ticks this entity has lived for.

This is the equivalent to "age" in entities. May not be less than one tick.

Parameters
valueAge of entity
void org.bukkit.entity.Entity.setVelocity ( Vector  velocity)

Sets this entity's velocity.

Parameters
velocityNew velocity to travel with
boolean org.bukkit.entity.Entity.teleport ( Location  location)

Teleports this entity to the given location.

Parameters
locationNew location to teleport this entity to
Returns
true if the teleport was successful

Referenced by org.bukkit.command.defaults.TeleportCommand.execute().

boolean org.bukkit.entity.Entity.teleport ( Location  location,
TeleportCause  cause 
)

Teleports this entity to the given location.

Parameters
locationNew location to teleport this entity to
causeThe cause of this teleportation
Returns
true if the teleport was successful
boolean org.bukkit.entity.Entity.teleport ( Entity  destination)

Teleports this entity to the target Entity.

Parameters
destinationEntity to teleport this entity to
Returns
true if the teleport was successful
boolean org.bukkit.entity.Entity.teleport ( Entity  destination,
TeleportCause  cause 
)

Teleports this entity to the target Entity.

Parameters
destinationEntity to teleport this entity to
causeThe cause of this teleportation
Returns
true if the teleport was successful

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