Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.entity.LivingEntity Interface Reference
Inheritance diagram for org.bukkit.entity.LivingEntity:
org.bukkit.entity.Entity org.bukkit.entity.Damageable org.bukkit.projectiles.ProjectileSource org.bukkit.metadata.Metadatable org.bukkit.entity.Entity org.bukkit.metadata.Metadatable org.bukkit.entity.Ambient org.bukkit.entity.ComplexLivingEntity org.bukkit.entity.Creature org.bukkit.entity.Flying org.bukkit.entity.HumanEntity org.bukkit.entity.Slime org.bukkit.entity.Bat org.bukkit.entity.EnderDragon org.bukkit.entity.Ageable org.bukkit.entity.Golem org.bukkit.entity.Monster org.bukkit.entity.NPC org.bukkit.entity.WaterMob org.bukkit.entity.Ghast org.bukkit.entity.Player org.bukkit.entity.MagmaCube

Public Member Functions

double getEyeHeight ()
 
double getEyeHeight (boolean ignoreSneaking)
 
Location getEyeLocation ()
 
List< BlockgetLineOfSight (HashSet< Byte > transparent, int maxDistance)
 
Block getTargetBlock (HashSet< Byte > transparent, int maxDistance)
 
List< BlockgetLastTwoTargetBlocks (HashSet< Byte > transparent, int maxDistance)
 
Egg throwEgg ()
 
Snowball throwSnowball ()
 
Arrow shootArrow ()
 
int getRemainingAir ()
 
void setRemainingAir (int ticks)
 
int getMaximumAir ()
 
void setMaximumAir (int ticks)
 
int getMaximumNoDamageTicks ()
 
void setMaximumNoDamageTicks (int ticks)
 
double getLastDamage ()
 
int _INVALID_getLastDamage ()
 
void setLastDamage (double damage)
 
void _INVALID_setLastDamage (int damage)
 
int getNoDamageTicks ()
 
void setNoDamageTicks (int ticks)
 
Player getKiller ()
 
boolean addPotionEffect (PotionEffect effect)
 
boolean addPotionEffect (PotionEffect effect, boolean force)
 
boolean addPotionEffects (Collection< PotionEffect > effects)
 
boolean hasPotionEffect (PotionEffectType type)
 
void removePotionEffect (PotionEffectType type)
 
Collection< PotionEffectgetActivePotionEffects ()
 
boolean hasLineOfSight (Entity other)
 
boolean getRemoveWhenFarAway ()
 
void setRemoveWhenFarAway (boolean remove)
 
EntityEquipment getEquipment ()
 
void setCanPickupItems (boolean pickup)
 
boolean getCanPickupItems ()
 
void setCustomName (String name)
 
String getCustomName ()
 
void setCustomNameVisible (boolean flag)
 
boolean isCustomNameVisible ()
 
boolean isLeashed ()
 
Entity getLeashHolder () throws IllegalStateException
 
boolean setLeashHolder (Entity holder)
 
- Public Member Functions inherited from org.bukkit.entity.Entity
Location getLocation ()
 
Location getLocation (Location loc)
 
void setVelocity (Vector velocity)
 
Vector getVelocity ()
 
boolean isOnGround ()
 
World getWorld ()
 
boolean teleport (Location location)
 
boolean teleport (Location location, TeleportCause cause)
 
boolean teleport (Entity destination)
 
boolean teleport (Entity destination, TeleportCause cause)
 
List< org.bukkit.entity.EntitygetNearbyEntities (double x, double y, double z)
 
int getEntityId ()
 
int getFireTicks ()
 
int getMaxFireTicks ()
 
void setFireTicks (int ticks)
 
void remove ()
 
boolean isDead ()
 
boolean isValid ()
 
Server getServer ()
 
abstract Entity getPassenger ()
 
abstract boolean setPassenger (Entity passenger)
 
abstract boolean isEmpty ()
 
abstract boolean eject ()
 
float getFallDistance ()
 
void setFallDistance (float distance)
 
void setLastDamageCause (EntityDamageEvent event)
 
EntityDamageEvent getLastDamageCause ()
 
UUID getUniqueId ()
 
int getTicksLived ()
 
void setTicksLived (int value)
 
void playEffect (EntityEffect type)
 
EntityType getType ()
 
boolean isInsideVehicle ()
 
boolean leaveVehicle ()
 
Entity getVehicle ()
 
- Public Member Functions inherited from org.bukkit.entity.Damageable
void damage (double amount)
 
void _INVALID_damage (int amount)
 
void damage (double amount, Entity source)
 
void _INVALID_damage (int amount, Entity source)
 
double getHealth ()
 
int _INVALID_getHealth ()
 
void setHealth (double health)
 
void _INVALID_setHealth (int health)
 
double getMaxHealth ()
 
int _INVALID_getMaxHealth ()
 
void setMaxHealth (double health)
 
void _INVALID_setMaxHealth (int health)
 
void resetMaxHealth ()
 
- Public Member Functions inherited from org.bukkit.projectiles.ProjectileSource
public< T extends Projectile > T launchProjectile (Class<?extends T > projectile)
 
public< T extends Projectile > T launchProjectile (Class<?extends T > projectile, Vector velocity)
 

Detailed Description

Represents a living entity, such as a monster or player

Definition at line 17 of file LivingEntity.java.

Member Function Documentation

int org.bukkit.entity.LivingEntity._INVALID_getLastDamage ( )

This method exists for legacy reasons to provide backwards compatibility. It will not exist at runtime and should not be used under any circumstances.

void org.bukkit.entity.LivingEntity._INVALID_setLastDamage ( int  damage)

This method exists for legacy reasons to provide backwards compatibility. It will not exist at runtime and should not be used under any circumstances.

boolean org.bukkit.entity.LivingEntity.addPotionEffect ( PotionEffect  effect)

Adds the given PotionEffect to the living entity.

Only one potion effect can be present for a given PotionEffectType.

Parameters
effectPotionEffect to be added
Returns
whether the effect could be added

Referenced by org.bukkit.potion.PotionEffect.apply().

boolean org.bukkit.entity.LivingEntity.addPotionEffect ( PotionEffect  effect,
boolean  force 
)

Adds the given PotionEffect to the living entity.

Only one potion effect can be present for a given PotionEffectType.

Parameters
effectPotionEffect to be added
forcewhether conflicting effects should be removed
Returns
whether the effect could be added
boolean org.bukkit.entity.LivingEntity.addPotionEffects ( Collection< PotionEffect effects)

Attempts to add all of the given PotionEffect to the living entity.

Parameters
effectsthe effects to add
Returns
whether all of the effects could be added

Referenced by org.bukkit.potion.Potion.apply().

Collection<PotionEffect> org.bukkit.entity.LivingEntity.getActivePotionEffects ( )

Returns all currently active PotionEffects on the living entity.

Returns
a collection of PotionEffects
boolean org.bukkit.entity.LivingEntity.getCanPickupItems ( )

Gets if the living entity can pick up items.

Returns
whether or not the living entity can pick up items
String org.bukkit.entity.LivingEntity.getCustomName ( )

Gets the custom name on a mob. If there is no name this method will return null.

This value has no effect on players, they will always use their real name.

Returns
name of the mob or null
EntityEquipment org.bukkit.entity.LivingEntity.getEquipment ( )

Gets the inventory with the equipment worn by the living entity.

Returns
the living entity's inventory
double org.bukkit.entity.LivingEntity.getEyeHeight ( )

Gets the height of the living entity's eyes above its Location.

Returns
height of the living entity's eyes above its location

Referenced by org.bukkit.util.BlockIterator.BlockIterator().

double org.bukkit.entity.LivingEntity.getEyeHeight ( boolean  ignoreSneaking)

Gets the height of the living entity's eyes above its Location.

Parameters
ignoreSneakingif set to true, the effects of sneaking will be ignored
Returns
height of the living entity's eyes above its location
Location org.bukkit.entity.LivingEntity.getEyeLocation ( )

Get a Location detailing the current eye position of the living entity.

Returns
a location at the eyes of the living entity
Player org.bukkit.entity.LivingEntity.getKiller ( )

Gets the player identified as the killer of the living entity.

May be null.

Returns
killer player, or null if none found
double org.bukkit.entity.LivingEntity.getLastDamage ( )

Returns the living entity's last damage taken in the current no damage ticks time.

Only damage higher than this amount will further damage the living entity.

Returns
damage taken since the last no damage ticks time period
List<Block> org.bukkit.entity.LivingEntity.getLastTwoTargetBlocks ( HashSet< Byte >  transparent,
int  maxDistance 
)

Gets the last two blocks along the living entity's line of sight.

The target block will be the last block in the list.

Parameters
transparentHashSet containing all transparent block IDs (set to null for only air)
maxDistancethis is the maximum distance to scan. This may be further limited by the server, but never to less than 100 blocks
Returns
list containing the last 2 blocks along the living entity's line of sight
Deprecated:
Magic value
Entity org.bukkit.entity.LivingEntity.getLeashHolder ( ) throws IllegalStateException

Gets the entity that is currently leading this entity.

Returns
the entity holding the leash
Exceptions
IllegalStateExceptionif not currently leashed
List<Block> org.bukkit.entity.LivingEntity.getLineOfSight ( HashSet< Byte >  transparent,
int  maxDistance 
)

Gets all blocks along the living entity's line of sight.

This list contains all blocks from the living entity's eye position to target inclusive.

Parameters
transparentHashSet containing all transparent block IDs (set to null for only air)
maxDistancethis is the maximum distance to scan (may be limited by server by at least 100 blocks, no less)
Returns
list containing all blocks along the living entity's line of sight
Deprecated:
Magic value
int org.bukkit.entity.LivingEntity.getMaximumAir ( )

Returns the maximum amount of air the living entity can have, in ticks.

Returns
maximum amount of air
int org.bukkit.entity.LivingEntity.getMaximumNoDamageTicks ( )

Returns the living entity's current maximum no damage ticks.

This is the maximum duration in which the living entity will not take damage.

Returns
maximum no damage ticks
int org.bukkit.entity.LivingEntity.getNoDamageTicks ( )

Returns the living entity's current no damage ticks.

Returns
amount of no damage ticks
int org.bukkit.entity.LivingEntity.getRemainingAir ( )

Returns the amount of air that the living entity has remaining, in ticks.

Returns
amount of air remaining
boolean org.bukkit.entity.LivingEntity.getRemoveWhenFarAway ( )

Returns if the living entity despawns when away from players or not.

By default, animals are not removed while other mobs are.

Returns
true if the living entity is removed when away from players
Block org.bukkit.entity.LivingEntity.getTargetBlock ( HashSet< Byte >  transparent,
int  maxDistance 
)

Gets the block that the living entity has targeted.

Parameters
transparentHashSet containing all transparent block IDs (set to null for only air)
maxDistancethis is the maximum distance to scan (may be limited by server by at least 100 blocks, no less)
Returns
block that the living entity has targeted
Deprecated:
Magic value
boolean org.bukkit.entity.LivingEntity.hasLineOfSight ( Entity  other)

Checks whether the living entity has block line of sight to another.

This uses the same algorithm that hostile mobs use to find the closest player.

Parameters
otherthe entity to determine line of sight to
Returns
true if there is a line of sight, false if not
boolean org.bukkit.entity.LivingEntity.hasPotionEffect ( PotionEffectType  type)

Returns whether the living entity already has an existing effect of the given PotionEffectType applied to it.

Parameters
typethe potion type to check
Returns
whether the living entity has this potion effect active on them
boolean org.bukkit.entity.LivingEntity.isCustomNameVisible ( )

Gets whether or not the mob's custom name is displayed client side.

This value has no effect on players, they will always display their name.

Returns
if the custom name is displayed
boolean org.bukkit.entity.LivingEntity.isLeashed ( )

Returns whether the entity is currently leashed.

Returns
whether the entity is leashed
void org.bukkit.entity.LivingEntity.removePotionEffect ( PotionEffectType  type)

Removes any effects present of the given PotionEffectType.

Parameters
typethe potion type to remove
void org.bukkit.entity.LivingEntity.setCanPickupItems ( boolean  pickup)

Sets whether or not the living entity can pick up items.

Parameters
pickupwhether or not the living entity can pick up items
void org.bukkit.entity.LivingEntity.setCustomName ( String  name)

Sets a custom name on a mob. This name will be used in death messages and can be sent to the client as a nameplate over the mob.

Setting the name to null or an empty string will clear it.

This value has no effect on players, they will always use their real name.

Parameters
namethe name to set
void org.bukkit.entity.LivingEntity.setCustomNameVisible ( boolean  flag)

Sets whether or not to display the mob's custom name client side. The name will be displayed above the mob similarly to a player.

This value has no effect on players, they will always display their name.

Parameters
flagcustom name or not
void org.bukkit.entity.LivingEntity.setLastDamage ( double  damage)

Sets the damage dealt within the current no damage ticks time period.

Parameters
damageamount of damage
boolean org.bukkit.entity.LivingEntity.setLeashHolder ( Entity  holder)

Sets the leash on this entity to be held by the supplied entity.

This method has no effect on EnderDragons, Withers, Players, or Bats. Non-living entities excluding leashes will not persist as leash holders.

Parameters
holderthe entity to leash this entity to
Returns
whether the operation was successful
void org.bukkit.entity.LivingEntity.setMaximumAir ( int  ticks)

Sets the maximum amount of air the living entity can have, in ticks.

Parameters
ticksmaximum amount of air
void org.bukkit.entity.LivingEntity.setMaximumNoDamageTicks ( int  ticks)

Sets the living entity's current maximum no damage ticks.

Parameters
ticksmaximum amount of no damage ticks
void org.bukkit.entity.LivingEntity.setNoDamageTicks ( int  ticks)

Sets the living entity's current no damage ticks.

Parameters
ticksamount of no damage ticks
void org.bukkit.entity.LivingEntity.setRemainingAir ( int  ticks)

Sets the amount of air that the living entity has remaining, in ticks.

Parameters
ticksamount of air remaining
void org.bukkit.entity.LivingEntity.setRemoveWhenFarAway ( boolean  remove)

Sets whether or not the living entity despawns when away from players or not.

Parameters
removethe removal status
Arrow org.bukkit.entity.LivingEntity.shootArrow ( )

Shoots an arrow from the living entity.

Deprecated:
use launchProjectile(Arrow.class) instead
Returns
the arrow shot
Egg org.bukkit.entity.LivingEntity.throwEgg ( )

Throws an egg from the living entity.

Deprecated:
use launchProjectile(Egg.class) instead
Returns
the egg thrown
Snowball org.bukkit.entity.LivingEntity.throwSnowball ( )

Throws a snowball from the living entity.

Deprecated:
use launchProjectile(Snowball.class) instead
Returns
the snowball thrown

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