Class BaseEntity

java.lang.Object
  extended by BaseEntity
Direct Known Subclasses:
BaseVehicle, LivingEntity

public class BaseEntity
extends java.lang.Object

BaseEntity.java - Class for accessing things that all entities share - X, Y, Z, health.


Constructor Summary
Constructor and Description
BaseEntity()
          Interface for entities.
BaseEntity(fe entity)
          Creates an interface for an entity
 
Method Summary
Modifier and Type Method and Description
 int getAirTicks()
          Get the amount of AirTicks left.
 int getBaseAirTicks()
          Get the default amount of AirTicks for this entity 20 ticks per second.
 fe getEntity()
          Returns the entity we're wrapping.
 int getFireTicks()
          Get the amount of FireTicks left.
 int getId()
          Returns the ID for this mob
 int getNoDamageTicks()
          Get the current NoDamageTicks for this entity This gets lowered every game tick, until its smaller than half the BaseNoDamageTicks it only registers any damage more than LivingEntity.getLastDamage().
 float getPitch()
          Returns the entity's pitch
 Player getPlayer()
          Returns the player for this entity
 float getRotation()
          Returns the entity's rotation
 double getX()
          Returns the entity's X
 double getY()
          Returns the entity's Y
 double getZ()
          Returns the entity's Z
 boolean isAnimal()
          Returns whether or not this entity is an animal
 boolean isLiving()
          Returns whether or not this entity is alive
 boolean isMob()
          Returns whether or not this entity is a mob
 boolean isPlayer()
          Returns true if this entity is a player
 void setAirTicks(int ticks)
          Set the amount of AirTicks left.
 void setBaseAirTicks(int ticks)
          Set the default amount of AirTicks for this entity 20 ticks per second.
 void setFireTicks(int ticks)
          Set the amount of FireTicks left.
 void setNoDamageTicks(int ticks)
          Set the current NoDamageTicks for this entity This gets lowered every game tick, until its smaller than half the BaseNoDamageTicks it only registers any damage more than LivingEntity.getLastDamage().
 void setPitch(float pitch)
          Sets the entity's pitch
 void setRotation(float rotation)
          Sets the entity's rotation
 void setX(double x)
          Sets the entity's X
 void setY(double y)
          Sets the entity's Y
 void setZ(double z)
          Sets the entity's Z
 void teleportTo(BaseEntity ent)
          Teleports to the other entity
 void teleportTo(double x, double y, double z, float rotation, float pitch)
          Teleports to the provided location
 void teleportTo(Location location)
          Teleports to the provided location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEntity

public BaseEntity(fe entity)
Creates an interface for an entity

Parameters:
entity -

BaseEntity

public BaseEntity()
Interface for entities.

Method Detail

getId

public int getId()
Returns the ID for this mob

Returns:
id

teleportTo

public void teleportTo(double x,
                       double y,
                       double z,
                       float rotation,
                       float pitch)
Teleports to the provided location

Parameters:
x -
rotation -
y -
z -
pitch -

teleportTo

public void teleportTo(BaseEntity ent)
Teleports to the other entity

Parameters:
ent - entity to teleport to

teleportTo

public void teleportTo(Location location)
Teleports to the provided location

Parameters:
location - location to teleport to

getX

public double getX()
Returns the entity's X

Returns:
x

setX

public void setX(double x)
Sets the entity's X

Parameters:
x - x to set

getY

public double getY()
Returns the entity's Y

Returns:
y

setY

public void setY(double y)
Sets the entity's Y

Parameters:
y - y to set

getZ

public double getZ()
Returns the entity's Z

Returns:
z

setZ

public void setZ(double z)
Sets the entity's Z

Parameters:
z - z to set

getPitch

public float getPitch()
Returns the entity's pitch

Returns:
pitch

setPitch

public void setPitch(float pitch)
Sets the entity's pitch

Parameters:
pitch - pitch to set

getRotation

public float getRotation()
Returns the entity's rotation

Returns:
rotation

setRotation

public void setRotation(float rotation)
Sets the entity's rotation

Parameters:
rotation - rotation to set

getEntity

public fe getEntity()
Returns the entity we're wrapping.

Returns:

isMob

public boolean isMob()
Returns whether or not this entity is a mob

Returns:
true if mob

isAnimal

public boolean isAnimal()
Returns whether or not this entity is an animal

Returns:
true if animal

isPlayer

public boolean isPlayer()
Returns true if this entity is a player

Returns:
true if player

isLiving

public boolean isLiving()
Returns whether or not this entity is alive

Returns:
true if living entity

getPlayer

public Player getPlayer()
Returns the player for this entity

Returns:
player

getBaseAirTicks

public int getBaseAirTicks()
Get the default amount of AirTicks for this entity 20 ticks per second.

Returns:

setBaseAirTicks

public void setBaseAirTicks(int ticks)
Set the default amount of AirTicks for this entity 20 ticks per second.

Parameters:
ticks -

getNoDamageTicks

public int getNoDamageTicks()
Get the current NoDamageTicks for this entity This gets lowered every game tick, until its smaller than half the BaseNoDamageTicks it only registers any damage more than LivingEntity.getLastDamage(). 20 ticks per second.

Returns:

setNoDamageTicks

public void setNoDamageTicks(int ticks)
Set the current NoDamageTicks for this entity This gets lowered every game tick, until its smaller than half the BaseNoDamageTicks it only registers any damage more than LivingEntity.getLastDamage(). 20 ticks per second.

Parameters:
ticks -

getAirTicks

public int getAirTicks()
Get the amount of AirTicks left. This gets lowered every game tick when you are under water. 20 ticks per second.

Returns:

setAirTicks

public void setAirTicks(int ticks)
Set the amount of AirTicks left. This gets lowered every game tick when you are under water. 20 ticks per second.


getFireTicks

public int getFireTicks()
Get the amount of FireTicks left. This gets lowered every game tick when you are on fire. 20 ticks per second.

Returns:

setFireTicks

public void setFireTicks(int ticks)
Set the amount of FireTicks left. This gets lowered every game tick when you are on fire. 20 ticks per second.