public abstract class GlowLivingEntity extends GlowEntity implements org.bukkit.entity.LivingEntity
Player
or Monster
.Modifier and Type | Field and Description |
---|---|
protected int |
deathTicks
The LivingEntity's number of ticks since death.
|
protected double |
health
The entity's health.
|
protected double |
maxHealth
The entity's max health.
|
protected org.bukkit.util.Vector |
movement
The entity's movement as a unit vector, applied each tick according to the entity's speed.
|
protected double |
speed
The speed multiplier of the entity.
|
protected TaskManager |
taskManager
The entity's AI task manager.
|
active, airDrag, applyDragBeforeAccel, boundingBox, ENTITY_ID_NOBODY, entityId, gravityAccel, liquidDrag, location, metadata, passengerChanged, previousLocation, removed, server, slipMultiplier, teleported, ticksLived, vehicle, velocity, velocityChanged, world, worldLock
Modifier | Constructor and Description |
---|---|
|
GlowLivingEntity(org.bukkit.Location location)
Creates a mob within the specified world.
|
protected |
GlowLivingEntity(org.bukkit.Location location,
double maxHealth)
Creates a mob within the specified world.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addPotionEffect(org.bukkit.potion.PotionEffect effect) |
boolean |
addPotionEffect(org.bukkit.potion.PotionEffect effect,
boolean force) |
boolean |
addPotionEffects(Collection<org.bukkit.potion.PotionEffect> effects) |
boolean |
canTakeDamage(org.bukkit.event.entity.EntityDamageEvent.DamageCause damageCause)
Get whether this entity should take damage from the specified source.
|
void |
clearActivePotionEffects() |
List<com.flowpowered.network.Message> |
createUpdateMessage(GlowSession session)
Creates a
Message which can be sent to a client to update this entity. |
void |
damage(double amount,
org.bukkit.entity.Entity source,
org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) |
boolean |
entityInteract(GlowPlayer player,
InteractEntityMessage message) |
org.bukkit.inventory.ItemStack |
getActiveItem() |
Collection<org.bukkit.potion.PotionEffect> |
getActivePotionEffects() |
protected int |
getAmbientDelay()
Get the minimal delay until the entity can produce an ambient sound.
|
protected org.bukkit.Sound |
getAmbientSound()
Get the ambient sound this entity makes randomly, or null for silence.
|
int |
getArrowsStuck()
The number of arrows stuck inside this entity.
|
org.bukkit.attribute.AttributeInstance |
getAttribute(org.bukkit.attribute.Attribute attribute) |
AttributeManager |
getAttributeManager()
The LivingEntity's AttributeManager.
|
boolean |
getCanPickupItems() |
protected org.bukkit.Sound |
getDeathSound()
Get the death sound of this entity, or null for silence.
|
int |
getDeathTicks()
The LivingEntity's number of ticks since death.
|
org.bukkit.inventory.EntityEquipment |
getEquipment() |
EquipmentMonitor |
getEquipmentMonitor()
Monitor for the equipment of this entity.
|
double |
getEyeHeight() |
double |
getEyeHeight(boolean ignoreSneaking) |
org.bukkit.Location |
getEyeLocation() |
int |
getHandRaisedTime() |
float |
getHeadYaw()
The head rotation of the living entity, if applicable.
|
double |
getHealth()
The entity's health.
|
protected org.bukkit.Sound |
getHurtSound()
Get the hurt sound of this entity, or null for silence.
|
int |
getItemUseRemainingTime() |
org.bukkit.entity.Player |
getKiller()
The player that killed this entity, or null if not killed by a player.
|
double |
getLastDamage()
The magnitude of the last damage the entity took.
|
org.bukkit.entity.Entity |
getLastDamager()
The last entity which damaged this living entity.
|
List<org.bukkit.block.Block> |
getLastTwoTargetBlocks(HashSet<Byte> transparent,
int maxDistance)
Deprecated.
|
List<org.bukkit.block.Block> |
getLastTwoTargetBlocks(Set<org.bukkit.Material> materials,
int maxDistance) |
List<org.bukkit.block.Block> |
getLineOfSight(Set<org.bukkit.Material> transparent,
int maxDistance) |
double |
getMaxHealth() |
int |
getMaximumAir()
The maximum amount of air the entity can hold.
|
int |
getMaximumNoDamageTicks()
The default length of the invincibility period.
|
org.bukkit.util.Vector |
getMovement()
The entity's movement as a unit vector, applied each tick according to the entity's speed.
|
int |
getNoDamageTicks()
The number of ticks remaining in the invincibility period.
|
int |
getPlayerDamageTick()
The tick that the entity got hit by a player.
|
org.bukkit.potion.PotionEffect |
getPotionEffect(org.bukkit.potion.PotionEffectType potionEffectType) |
int |
getRemainingAir()
How long the entity has until it runs out of air.
|
boolean |
getRemoveWhenFarAway() |
int |
getShieldBlockingDelay() |
protected float |
getSoundPitch()
The pitch of the sounds this entity makes.
|
protected float |
getSoundVolume()
The volume of the sounds this entity makes.
|
double |
getSpeed()
The speed multiplier of the entity.
|
MobState |
getState()
The entity's current AI state.
|
org.bukkit.block.Block |
getTargetBlock(HashSet<Byte> transparent,
int maxDistance)
Deprecated.
|
org.bukkit.block.Block |
getTargetBlock(Set<org.bukkit.Material> materials,
int maxDistance) |
TaskManager |
getTaskManager()
The entity's AI task manager.
|
protected org.bukkit.util.Vector |
getVelocityFromMovement() |
boolean |
hasAI() |
boolean |
hasLineOfSight(org.bukkit.entity.Entity other) |
boolean |
hasPotionEffect(org.bukkit.potion.PotionEffectType type) |
boolean |
isArthropod()
Get whether of not this entity is an arthropod.
|
boolean |
isCollidable()
Whether entities can collide with this entity.
|
boolean |
isFallFlying()
Whether the entity can automatically glide when falling with an Elytra equipped.
|
boolean |
isGliding() |
boolean |
isHandRaised() |
boolean |
isUndead()
Get whether or not this entity is undead.
|
boolean |
isWithinSolidBlock()
Returns whether the entity's eye location is within a solid block.
|
protected void |
jump() |
<T extends org.bukkit.entity.Projectile> |
launchProjectile(Class<? extends T> type) |
protected <T extends org.bukkit.entity.Projectile> |
launchProjectile(Class<? extends T> type,
org.bukkit.Location location,
org.bukkit.util.Vector originalVector,
float pitchOffset,
float velocity)
Launches a projectile from this entity in the horizontal direction it is facing, relative to
the given velocity vector.
|
<T extends org.bukkit.entity.Projectile> |
launchProjectile(Class<? extends T> type,
org.bukkit.util.Vector vector) |
<T extends org.bukkit.entity.Projectile> |
launchProjectile(Class<? extends T> type,
org.bukkit.util.Vector vector,
float offset,
float speed)
Launches a projectile from this entity.
|
void |
playAnimation(org.bukkit.EntityAnimation animation) |
void |
pulse()
Called every game cycle.
|
protected void |
pulsePhysics() |
void |
removePotionEffect(org.bukkit.potion.PotionEffectType type) |
void |
reset()
Resets the previous location and other properties to their current value.
|
void |
resetMaxHealth() |
void |
setAI(boolean ai) |
void |
setArrowsStuck(int arrowsStuck)
The number of arrows stuck inside this entity.
|
void |
setCanPickupItems(boolean canPickupItems)
Whether the (non-Player) entity can pick up armor and tools.
|
void |
setCollidable(boolean collidable)
Whether entities can collide with this entity.
|
void |
setFallFlying(boolean fallFlying)
Whether the entity can automatically glide when falling with an Elytra equipped.
|
void |
setGliding(boolean gliding) |
void |
setHeadYaw(float headYaw) |
void |
setHealth(double health) |
void |
setKiller(org.bukkit.entity.Player killer)
The player that killed this entity, or null if not killed by a player.
|
void |
setLastDamage(double lastDamage)
The magnitude of the last damage the entity took.
|
void |
setLastDamager(org.bukkit.entity.Entity lastDamager)
The last entity which damaged this living entity.
|
void |
setMaxHealth(double health) |
void |
setMaximumAir(int ticks) |
void |
setMaximumNoDamageTicks(int maximumNoDamageTicks)
The default length of the invincibility period.
|
void |
setMovement(org.bukkit.util.Vector movement)
The entity's movement as a unit vector, applied each tick according to the entity's speed.
|
void |
setNoDamageTicks(int noDamageTicks)
The number of ticks remaining in the invincibility period.
|
void |
setOnGround(boolean onGround)
Sets the on-ground flag and clears fall distance.
|
void |
setPlayerDamageTick(int playerDamageTick)
The tick that the entity got hit by a player.
|
void |
setRemainingAir(int ticks) |
void |
setRemoveWhenFarAway(boolean removeWhenFarAway)
Whether the entity should be removed if it is too distant from players.
|
void |
setShieldBlockingDelay(int delay) |
void |
setSpeed(double speed)
The speed multiplier of the entity.
|
void |
setState(MobState state)
Sets the AI state.
|
boolean |
tryUseTotem()
Use "Totem of Undying" if equipped
|
protected void |
updatePotionEffectsMetadata() |
addAttachment, addAttachment, addAttachment, addAttachment, addPassenger, addScoreboardTag, collide, createAfterSpawnMessage, createSpawnMessage, damage, damage, damage, eject, equals, fromMobSpawner, getCardinalFacing, getChunk, getCustomName, getCustomTags, getDismountLocation, getEffectivePermissions, getEntityId, getFacing, getFallDistance, getFireTicks, getGravityAccel, getHeight, getLastDamageCause, getLeashedEntities, getLeashHolder, getLocation, getLocation, getMaxFireTicks, getMetadata, getMetadata, getMountLocation, getName, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasDefaultLandingBehavior, hasFriction, hasGravity, hashCode, hasMetadata, hasMoved, hasPermission, hasPermission, hasRotated, intersects, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isLeashed, isOnGround, isOp, isPermissionSet, isPermissionSet, isRemoved, isSilent, isTeleported, isTouchingMaterial, isValid, isWithinDistance, isWithinDistance, leaveVehicle, playEffect, playEffectKnownAndSelf, recalculatePermissions, remove, removeAttachment, removeMetadata, removePassenger, removeScoreboardTag, sendMessage, sendMessage, setAirDrag, setApplyDragBeforeAccel, setBoundingBox, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setFriction, setGlowing, setGravity, setGravityAccel, setInvulnerable, setLastDamageCause, setLeashHolder, setLeashHolderUniqueId, setLiquidDrag, setMetadata, setOp, setPassenger, setPortalCooldown, setRawLocation, setRawLocation, setSilent, setSize, setTicksLived, setUniqueId, setVelocity, shouldSave, spigot, teleport, teleport, teleport, teleport, teleportToEnd, teleportToSpawn, toString, updateBoundingBox
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLeashHolder, isLeashed, setLeashHolder
addPassenger, addScoreboardTag, eject, fromMobSpawner, getChunk, getEntityId, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isOnGround, isSilent, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPortalCooldown, setSilent, setTicksLived, setVelocity, spigot, teleport, teleport, teleport, teleport
getMetadata, hasMetadata, removeMetadata, setMetadata
getName, sendMessage, sendMessage, sendMessage, sendMessage
protected final TaskManager taskManager
protected double health
protected double maxHealth
protected int deathTicks
protected org.bukkit.util.Vector movement
The entity's movement as a unit vector, applied each tick according to the entity's speed.
The y value is not used. X is used for forward movement and z is used for sideways movement. These values are relative to the entity's current yaw.
protected double speed
public GlowLivingEntity(org.bukkit.Location location)
location
- The location.protected GlowLivingEntity(org.bukkit.Location location, double maxHealth)
location
- The location.maxHealth
- The max health of this mob.public void pulse()
GlowEntity
pulse
in class GlowEntity
protected void pulsePhysics()
pulsePhysics
in class GlowEntity
protected org.bukkit.util.Vector getVelocityFromMovement()
protected void jump()
public void reset()
GlowEntity
reset
in class GlowEntity
public List<com.flowpowered.network.Message> createUpdateMessage(GlowSession session)
GlowEntity
Message
which can be sent to a client to update this entity.createUpdateMessage
in class GlowEntity
session
- Session to update this entity forpublic double getEyeHeight()
getEyeHeight
in interface org.bukkit.entity.LivingEntity
public double getEyeHeight(boolean ignoreSneaking)
getEyeHeight
in interface org.bukkit.entity.LivingEntity
public org.bukkit.Location getEyeLocation()
getEyeLocation
in interface org.bukkit.entity.LivingEntity
public boolean hasLineOfSight(org.bukkit.entity.Entity other)
hasLineOfSight
in interface org.bukkit.entity.LivingEntity
public void setHeadYaw(float headYaw)
public org.bukkit.inventory.EntityEquipment getEquipment()
getEquipment
in interface org.bukkit.entity.LivingEntity
public void setRemainingAir(int ticks)
setRemainingAir
in interface org.bukkit.entity.LivingEntity
public void setMaximumAir(int ticks)
setMaximumAir
in interface org.bukkit.entity.LivingEntity
public boolean getRemoveWhenFarAway()
getRemoveWhenFarAway
in interface org.bukkit.entity.LivingEntity
public boolean getCanPickupItems()
getCanPickupItems
in interface org.bukkit.entity.LivingEntity
protected org.bukkit.Sound getHurtSound()
protected org.bukkit.Sound getDeathSound()
protected org.bukkit.Sound getAmbientSound()
protected int getAmbientDelay()
protected float getSoundVolume()
protected float getSoundPitch()
public boolean canTakeDamage(org.bukkit.event.entity.EntityDamageEvent.DamageCause damageCause)
Usually used to check environmental sources such as drowning.
damageCause
- the damage source to checkpublic boolean isArthropod()
public boolean isUndead()
public List<org.bukkit.block.Block> getLineOfSight(Set<org.bukkit.Material> transparent, int maxDistance)
getLineOfSight
in interface org.bukkit.entity.LivingEntity
@Deprecated public org.bukkit.block.Block getTargetBlock(HashSet<Byte> transparent, int maxDistance)
public org.bukkit.block.Block getTargetBlock(Set<org.bukkit.Material> materials, int maxDistance)
getTargetBlock
in interface org.bukkit.entity.LivingEntity
@Deprecated public List<org.bukkit.block.Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance)
public List<org.bukkit.block.Block> getLastTwoTargetBlocks(Set<org.bukkit.Material> materials, int maxDistance)
getLastTwoTargetBlocks
in interface org.bukkit.entity.LivingEntity
public boolean isWithinSolidBlock()
public <T extends org.bukkit.entity.Projectile> T launchProjectile(Class<? extends T> type)
launchProjectile
in interface org.bukkit.projectiles.ProjectileSource
public <T extends org.bukkit.entity.Projectile> T launchProjectile(Class<? extends T> type, org.bukkit.util.Vector vector)
launchProjectile
in interface org.bukkit.projectiles.ProjectileSource
public <T extends org.bukkit.entity.Projectile> T launchProjectile(Class<? extends T> type, org.bukkit.util.Vector vector, float offset, float speed)
T
- the projectile classtype
- the projectile classvector
- the direction to shoot inoffset
- TODO: document this parameterspeed
- the speed for the first flight tickprotected <T extends org.bukkit.entity.Projectile> T launchProjectile(Class<? extends T> type, org.bukkit.Location location, org.bukkit.util.Vector originalVector, float pitchOffset, float velocity)
T
- the projectile classtype
- the projectile classlocation
- the location to launch the projectile fromoriginalVector
- the direction to shoot inpitchOffset
- degrees to subtract from the pitch angle while calculating the y
component of the initial directionvelocity
- the speed for the first flight tickpublic void setHealth(double health)
setHealth
in interface org.bukkit.entity.Damageable
public void damage(double amount, org.bukkit.entity.Entity source, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)
damage
in interface org.bukkit.entity.Damageable
damage
in class GlowEntity
public double getMaxHealth()
getMaxHealth
in interface org.bukkit.entity.Damageable
public void setMaxHealth(double health)
setMaxHealth
in interface org.bukkit.entity.Damageable
public void resetMaxHealth()
resetMaxHealth
in interface org.bukkit.entity.Damageable
public boolean addPotionEffect(org.bukkit.potion.PotionEffect effect)
addPotionEffect
in interface org.bukkit.entity.LivingEntity
public boolean addPotionEffect(org.bukkit.potion.PotionEffect effect, boolean force)
addPotionEffect
in interface org.bukkit.entity.LivingEntity
public boolean addPotionEffects(Collection<org.bukkit.potion.PotionEffect> effects)
addPotionEffects
in interface org.bukkit.entity.LivingEntity
public boolean hasPotionEffect(org.bukkit.potion.PotionEffectType type)
hasPotionEffect
in interface org.bukkit.entity.LivingEntity
public org.bukkit.potion.PotionEffect getPotionEffect(org.bukkit.potion.PotionEffectType potionEffectType)
getPotionEffect
in interface org.bukkit.entity.LivingEntity
public void removePotionEffect(org.bukkit.potion.PotionEffectType type)
removePotionEffect
in interface org.bukkit.entity.LivingEntity
public Collection<org.bukkit.potion.PotionEffect> getActivePotionEffects()
getActivePotionEffects
in interface org.bukkit.entity.LivingEntity
public void clearActivePotionEffects()
protected void updatePotionEffectsMetadata()
public void setOnGround(boolean onGround)
GlowEntity
setOnGround
in class GlowEntity
onGround
- true if this entity is now on the ground; false otherwisepublic boolean isGliding()
isGliding
in interface org.bukkit.entity.LivingEntity
public void setGliding(boolean gliding)
setGliding
in interface org.bukkit.entity.LivingEntity
public int getShieldBlockingDelay()
getShieldBlockingDelay
in interface org.bukkit.entity.LivingEntity
public void setShieldBlockingDelay(int delay)
setShieldBlockingDelay
in interface org.bukkit.entity.LivingEntity
public org.bukkit.inventory.ItemStack getActiveItem()
getActiveItem
in interface org.bukkit.entity.LivingEntity
public int getItemUseRemainingTime()
getItemUseRemainingTime
in interface org.bukkit.entity.LivingEntity
public int getHandRaisedTime()
getHandRaisedTime
in interface org.bukkit.entity.LivingEntity
public boolean isHandRaised()
isHandRaised
in interface org.bukkit.entity.LivingEntity
public void setState(MobState state)
state
- the new AI statepublic void setAI(boolean ai)
setAI
in interface org.bukkit.entity.LivingEntity
public boolean hasAI()
hasAI
in interface org.bukkit.entity.LivingEntity
public void playAnimation(org.bukkit.EntityAnimation animation)
playAnimation
in interface org.bukkit.entity.LivingEntity
public org.bukkit.attribute.AttributeInstance getAttribute(org.bukkit.attribute.Attribute attribute)
getAttribute
in interface org.bukkit.attribute.Attributable
public boolean entityInteract(GlowPlayer player, InteractEntityMessage message)
entityInteract
in class GlowEntity
public boolean tryUseTotem()
public org.bukkit.entity.Player getKiller()
getKiller
in interface org.bukkit.entity.LivingEntity
public void setKiller(org.bukkit.entity.Player killer)
setKiller
in interface org.bukkit.entity.LivingEntity
public int getPlayerDamageTick()
public void setPlayerDamageTick(int playerDamageTick)
public boolean isCollidable()
isCollidable
in interface org.bukkit.entity.LivingEntity
public void setCollidable(boolean collidable)
setCollidable
in interface org.bukkit.entity.LivingEntity
public int getArrowsStuck()
getArrowsStuck
in interface org.bukkit.entity.LivingEntity
public void setArrowsStuck(int arrowsStuck)
setArrowsStuck
in interface org.bukkit.entity.LivingEntity
public TaskManager getTaskManager()
public AttributeManager getAttributeManager()
public double getHealth()
getHealth
in interface org.bukkit.entity.Damageable
public int getDeathTicks()
public org.bukkit.util.Vector getMovement()
The entity's movement as a unit vector, applied each tick according to the entity's speed.
The y value is not used. X is used for forward movement and z is used for sideways movement. These values are relative to the entity's current yaw.
public void setMovement(org.bukkit.util.Vector movement)
The entity's movement as a unit vector, applied each tick according to the entity's speed.
The y value is not used. X is used for forward movement and z is used for sideways movement. These values are relative to the entity's current yaw.
public double getSpeed()
public void setSpeed(double speed)
public double getLastDamage()
getLastDamage
in interface org.bukkit.entity.LivingEntity
public void setLastDamage(double lastDamage)
setLastDamage
in interface org.bukkit.entity.LivingEntity
public int getRemainingAir()
getRemainingAir
in interface org.bukkit.entity.LivingEntity
public int getMaximumAir()
getMaximumAir
in interface org.bukkit.entity.LivingEntity
public int getNoDamageTicks()
getNoDamageTicks
in interface org.bukkit.entity.LivingEntity
public void setNoDamageTicks(int noDamageTicks)
setNoDamageTicks
in interface org.bukkit.entity.LivingEntity
public int getMaximumNoDamageTicks()
getMaximumNoDamageTicks
in interface org.bukkit.entity.LivingEntity
public void setMaximumNoDamageTicks(int maximumNoDamageTicks)
setMaximumNoDamageTicks
in interface org.bukkit.entity.LivingEntity
public void setRemoveWhenFarAway(boolean removeWhenFarAway)
setRemoveWhenFarAway
in interface org.bukkit.entity.LivingEntity
public void setCanPickupItems(boolean canPickupItems)
setCanPickupItems
in interface org.bukkit.entity.LivingEntity
public EquipmentMonitor getEquipmentMonitor()
public boolean isFallFlying()
public void setFallFlying(boolean fallFlying)
public org.bukkit.entity.Entity getLastDamager()
public void setLastDamager(org.bukkit.entity.Entity lastDamager)
public float getHeadYaw()
public MobState getState()
Copyright © 2021. All rights reserved.