public interface LivingEntity extends Entity, Damageable, ProjectileSource
Modifier and Type | Method and Description |
---|---|
int |
_INVALID_getLastDamage()
Deprecated.
|
void |
_INVALID_setLastDamage(int damage)
Deprecated.
|
boolean |
addPotionEffect(PotionEffect effect)
Adds the given
PotionEffect to the living entity. |
boolean |
addPotionEffect(PotionEffect effect,
boolean force)
Adds the given
PotionEffect to the living entity. |
boolean |
addPotionEffects(Collection<PotionEffect> effects)
Attempts to add all of the given
PotionEffect to the living
entity. |
Collection<PotionEffect> |
getActivePotionEffects()
Returns all currently active
PotionEffect s on the living
entity. |
boolean |
getCanPickupItems()
Gets if the living entity can pick up items.
|
EntityEquipment |
getEquipment()
Gets the inventory with the equipment worn by the living entity.
|
double |
getEyeHeight()
Gets the height of the living entity's eyes above its Location.
|
double |
getEyeHeight(boolean ignoreSneaking)
Gets the height of the living entity's eyes above its Location.
|
Location |
getEyeLocation()
Get a Location detailing the current eye position of the living entity.
|
Player |
getKiller()
Gets the player identified as the killer of the living entity.
|
double |
getLastDamage()
Returns the living entity's last damage taken in the current no damage
ticks time.
|
List<Block> |
getLastTwoTargetBlocks(HashSet<Byte> transparent,
int maxDistance)
Deprecated.
Magic value
|
Entity |
getLeashHolder()
Gets the entity that is currently leading this entity.
|
List<Block> |
getLineOfSight(HashSet<Byte> transparent,
int maxDistance)
Deprecated.
Magic value
|
int |
getMaximumAir()
Returns the maximum amount of air the living entity can have, in ticks.
|
int |
getMaximumNoDamageTicks()
Returns the living entity's current maximum no damage ticks.
|
int |
getNoDamageTicks()
Returns the living entity's current no damage ticks.
|
int |
getRemainingAir()
Returns the amount of air that the living entity has remaining, in
ticks.
|
boolean |
getRemoveWhenFarAway()
Returns if the living entity despawns when away from players or not.
|
Block |
getTargetBlock(HashSet<Byte> transparent,
int maxDistance)
Deprecated.
Magic value
|
boolean |
hasLineOfSight(Entity other)
Checks whether the living entity has block line of sight to another.
|
boolean |
hasPotionEffect(PotionEffectType type)
Returns whether the living entity already has an existing effect of
the given
PotionEffectType applied to it. |
boolean |
isLeashed()
Returns whether the entity is currently leashed.
|
void |
removePotionEffect(PotionEffectType type)
Removes any effects present of the given
PotionEffectType . |
void |
setCanPickupItems(boolean pickup)
Sets whether or not the living entity can pick up items.
|
void |
setLastDamage(double damage)
Sets the damage dealt within the current no damage ticks time period.
|
boolean |
setLeashHolder(Entity holder)
Sets the leash on this entity to be held by the supplied entity.
|
void |
setMaximumAir(int ticks)
Sets the maximum amount of air the living entity can have, in ticks.
|
void |
setMaximumNoDamageTicks(int ticks)
Sets the living entity's current maximum no damage ticks.
|
void |
setNoDamageTicks(int ticks)
Sets the living entity's current no damage ticks.
|
void |
setRemainingAir(int ticks)
Sets the amount of air that the living entity has remaining, in ticks.
|
void |
setRemoveWhenFarAway(boolean remove)
Sets whether or not the living entity despawns when away from players
or not.
|
Arrow |
shootArrow()
Deprecated.
use launchProjectile(Arrow.class) instead
|
Egg |
throwEgg()
Deprecated.
use launchProjectile(Egg.class) instead
|
Snowball |
throwSnowball()
Deprecated.
use launchProjectile(Snowball.class) instead
|
_INVALID_damage, _INVALID_damage, _INVALID_getHealth, _INVALID_getMaxHealth, _INVALID_setHealth, _INVALID_setMaxHealth, damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealth
eject, getCustomName, getEntityId, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWorld, isCustomNameVisible, isDead, isEmpty, isInsideVehicle, isOnGround, isValid, leaveVehicle, playEffect, remove, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setLastDamageCause, setPassenger, setTicksLived, setVelocity, teleport, teleport, teleport, teleport
getMetadata, hasMetadata, removeMetadata, setMetadata
getName, sendMessage, sendMessage
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
isOp, setOp
launchProjectile, launchProjectile
double getEyeHeight()
double getEyeHeight(boolean ignoreSneaking)
ignoreSneaking
- if set to true, the effects of sneaking will be
ignoredLocation getEyeLocation()
@Deprecated List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance)
This list contains all blocks from the living entity's eye position to target inclusive.
transparent
- HashSet containing all transparent block IDs (set to
null for only air)maxDistance
- this is the maximum distance to scan (may be limited
by server by at least 100 blocks, no less)@Deprecated Block getTargetBlock(HashSet<Byte> transparent, int maxDistance)
transparent
- HashSet containing all transparent block IDs (set to
null for only air)maxDistance
- this is the maximum distance to scan (may be limited
by server by at least 100 blocks, no less)@Deprecated List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance)
The target block will be the last block in the list.
transparent
- HashSet containing all transparent block IDs (set to
null for only air)maxDistance
- this is the maximum distance to scan. This may be
further limited by the server, but never to less than 100 blocks@Deprecated Egg throwEgg()
@Deprecated Snowball throwSnowball()
@Deprecated Arrow shootArrow()
int getRemainingAir()
void setRemainingAir(int ticks)
ticks
- amount of air remainingint getMaximumAir()
void setMaximumAir(int ticks)
ticks
- maximum amount of airint getMaximumNoDamageTicks()
This is the maximum duration in which the living entity will not take damage.
void setMaximumNoDamageTicks(int ticks)
ticks
- maximum amount of no damage ticksdouble getLastDamage()
Only damage higher than this amount will further damage the living entity.
@Deprecated int _INVALID_getLastDamage()
void setLastDamage(double damage)
damage
- amount of damage@Deprecated void _INVALID_setLastDamage(int damage)
damage
- amount of damageint getNoDamageTicks()
void setNoDamageTicks(int ticks)
ticks
- amount of no damage ticksPlayer getKiller()
May be null.
boolean addPotionEffect(PotionEffect effect)
PotionEffect
to the living entity.
Only one potion effect can be present for a given PotionEffectType
.
effect
- PotionEffect to be addedboolean addPotionEffect(PotionEffect effect, boolean force)
PotionEffect
to the living entity.
Only one potion effect can be present for a given PotionEffectType
.
effect
- PotionEffect to be addedforce
- whether conflicting effects should be removedboolean addPotionEffects(Collection<PotionEffect> effects)
PotionEffect
to the living
entity.effects
- the effects to addboolean hasPotionEffect(PotionEffectType type)
PotionEffectType
applied to it.type
- the potion type to checkvoid removePotionEffect(PotionEffectType type)
PotionEffectType
.type
- the potion type to removeCollection<PotionEffect> getActivePotionEffects()
PotionEffect
s on the living
entity.PotionEffect
sboolean hasLineOfSight(Entity other)
This uses the same algorithm that hostile mobs use to find the closest player.
other
- the entity to determine line of sight toboolean getRemoveWhenFarAway()
By default, animals are not removed while other mobs are.
void setRemoveWhenFarAway(boolean remove)
remove
- the removal statusEntityEquipment getEquipment()
void setCanPickupItems(boolean pickup)
pickup
- whether or not the living entity can pick up itemsboolean getCanPickupItems()
boolean isLeashed()
Entity getLeashHolder() throws IllegalStateException
IllegalStateException
- if not currently leashedboolean setLeashHolder(Entity holder)
This method has no effect on EnderDragons, Withers, Players, or Bats. Non-living entities excluding leashes will not persist as leash holders.
holder
- the entity to leash this entity toCopyright © 2015. All rights reserved.