|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LivingEntity
Represents a living entity, such as a monster or player
| Method Summary | ||
|---|---|---|
boolean |
addPotionEffect(PotionEffect effect)
Adds the given PotionEffect to this entity. |
|
boolean |
addPotionEffect(PotionEffect effect,
boolean force)
Adds the given PotionEffect to this entity. |
|
boolean |
addPotionEffects(Collection<PotionEffect> effects)
Attempts to add all of the given PotionEffect to this entity. |
|
Collection<PotionEffect> |
getActivePotionEffects()
Returns all currently active PotionEffects on this entity. |
|
boolean |
getCanPickupItems()
Gets if the entity can pick up items |
|
EntityEquipment |
getEquipment()
Gets the inventory with the equipment worn by this entity. |
|
double |
getEyeHeight()
Gets the height of the entity's head above its Location |
|
double |
getEyeHeight(boolean ignoreSneaking)
Gets the height of the entity's head above its Location |
|
Location |
getEyeLocation()
Get a Location detailing the current eye position of the LivingEntity. |
|
Player |
getKiller()
Gets the player identified as the killer of this entity. |
|
int |
getLastDamage()
Returns the entities lastDamage taken in the current noDamageTicks time. |
|
List<Block> |
getLastTwoTargetBlocks(HashSet<Byte> transparent,
int maxDistance)
Gets the last two blocks along the player's line of sight. |
|
List<Block> |
getLineOfSight(HashSet<Byte> transparent,
int maxDistance)
Gets all blocks along the player's line of sight List iterates from player's position to target inclusive |
|
int |
getMaximumAir()
Returns the maximum amount of air this entity can have, in ticks |
|
int |
getMaximumNoDamageTicks()
Returns the entities current maximum noDamageTicks This is the time in ticks the entity will become unable to take equal or less damage than the lastDamage |
|
int |
getNoDamageTicks()
Returns the entities current noDamageTicks |
|
int |
getRemainingAir()
Returns the amount of air that this entity has remaining, in ticks |
|
boolean |
getRemoveWhenFarAway()
Returns if the entity despawns when away from players or not. By default animals are not removed while other mobs are. |
|
Block |
getTargetBlock(HashSet<Byte> transparent,
int maxDistance)
Gets the block that the player has targeted |
|
boolean |
hasLineOfSight(Entity other)
Checks whether the entity has block line of sight to another. This uses the same algorithm that hostile mobs use to find the closest player. |
|
boolean |
hasPotionEffect(PotionEffectType type)
Returns whether the entity already has an existing effect of the given PotionEffectType applied to it. |
|
|
launchProjectile(Class<? extends T> projectile)
Launches a Projectile from the entity. |
|
void |
removePotionEffect(PotionEffectType type)
Removes any effects present of the given PotionEffectType. |
|
void |
setCanPickupItems(boolean pickup)
Sets whether or not the entity can pick up items |
|
void |
setLastDamage(int damage)
Sets the entities current maximum noDamageTicks |
|
void |
setMaximumAir(int ticks)
Sets the maximum amount of air this entity can have, in ticks |
|
void |
setMaximumNoDamageTicks(int ticks)
Sets the entities current maximum noDamageTicks |
|
void |
setNoDamageTicks(int ticks)
Sets the entities current noDamageTicks |
|
void |
setRemainingAir(int ticks)
Sets the amount of air that this entity has remaining, in ticks |
|
void |
setRemoveWhenFarAway(boolean remove)
Sets whether or not the 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 |
|
| Methods inherited from interface org.bukkit.entity.Damageable |
|---|
damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealth |
| Methods inherited from interface org.bukkit.entity.Entity |
|---|
eject, getEntityId, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWorld, isDead, isEmpty, isInsideVehicle, isValid, leaveVehicle, playEffect, remove, setFallDistance, setFireTicks, setLastDamageCause, setPassenger, setTicksLived, setVelocity, teleport, teleport, teleport, teleport |
| Methods inherited from interface org.bukkit.metadata.Metadatable |
|---|
getMetadata, hasMetadata, removeMetadata, setMetadata |
| Method Detail |
|---|
double getEyeHeight()
double getEyeHeight(boolean ignoreSneaking)
ignoreSneaking - If set to true, the effects of sneaking will be ignored
Location getEyeLocation()
List<Block> getLineOfSight(HashSet<Byte> transparent,
int maxDistance)
transparent - HashSet containing all transparent block IDs. If set to null only air is considered transparent.maxDistance - This is the maximum distance to scan. This may be further limited by the server, but never to less than 100 blocks.
Block getTargetBlock(HashSet<Byte> transparent,
int maxDistance)
transparent - HashSet containing all transparent block IDs. If set to null only air is considered transparent.maxDistance - This is the maximum distance to scan. This may be further limited by the server, but never to less than 100 blocks.
List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent,
int maxDistance)
transparent - HashSet containing all transparent block IDs. If set to null only air is considered transparent.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()
<T extends Projectile> T launchProjectile(Class<? extends T> projectile)
Projectile from the entity.
projectile - Class of the projectile to launch
int getRemainingAir()
void setRemainingAir(int ticks)
ticks - Amount of air remainingint getMaximumAir()
void setMaximumAir(int ticks)
ticks - Maximum amount of airint getMaximumNoDamageTicks()
void setMaximumNoDamageTicks(int ticks)
ticks - maximumNoDamageTicksint getLastDamage()
void setLastDamage(int damage)
damage - last damageint getNoDamageTicks()
void setNoDamageTicks(int ticks)
ticks - NoDamageTicksPlayer getKiller()
boolean addPotionEffect(PotionEffect effect)
PotionEffect to this entity.
Only one potion effect can be present for a given PotionEffectType.
effect - PotionEffect to be added
boolean addPotionEffect(PotionEffect effect,
boolean force)
PotionEffect to this entity.
Only one potion effect can be present for a given PotionEffectType.
effect - PotionEffect to be addedforce - Whether conflicting effects should be removed
boolean addPotionEffects(Collection<PotionEffect> effects)
PotionEffect to this entity.
effects - The effects to add
boolean hasPotionEffect(PotionEffectType type)
PotionEffectType applied to it.
type - The potion type to check
void removePotionEffect(PotionEffectType type)
PotionEffectType.
type - The potion type to removeCollection<PotionEffect> getActivePotionEffects()
PotionEffects on this entity.
PotionEffectsboolean hasLineOfSight(Entity other)
other - The entity to determine line of sight to.
boolean getRemoveWhenFarAway()
void setRemoveWhenFarAway(boolean remove)
remove - The remove statusEntityEquipment getEquipment()
void setCanPickupItems(boolean pickup)
pickup - Whether or not the entity can pick up itemsboolean getCanPickupItems()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||