|
||||||||||
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 PotionEffect s on this entity. |
|
boolean |
getCanPickupItems()
Gets if the entity can pick up items |
|
String |
getCustomName()
Gets the custom name on a mob. |
|
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. |
|
boolean |
isCustomNameVisible()
Gets whether or not the mob's custom name is displayed client side. |
|
|
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 |
setCustomName(String name)
Sets a custom name on a mob. |
|
void |
setCustomNameVisible(boolean flag)
Sets whether or not to display the mob's custom name client side. |
|
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 |
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()
PotionEffect
s on this entity.
PotionEffect
sboolean 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()
void setCustomName(String name)
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.
name
- name to setString getCustomName()
This value has no effect on players, they will always use their real name.
void setCustomNameVisible(boolean flag)
This value has no effect on players, they will always display their name.
flag
- show custom nameboolean isCustomNameVisible()
This value has no effect on players, they will always display their name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |