Class GlowLivingEntity
- All Implemented Interfaces:
net.kyori.adventure.audience.Audience
,net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>
,org.bukkit.attribute.Attributable
,org.bukkit.command.CommandSender
,org.bukkit.entity.Damageable
,org.bukkit.entity.Entity
,org.bukkit.entity.LivingEntity
,org.bukkit.metadata.Metadatable
,org.bukkit.Nameable
,org.bukkit.permissions.Permissible
,org.bukkit.permissions.ServerOperator
,org.bukkit.persistence.PersistentDataHolder
,org.bukkit.projectiles.ProjectileSource
- Direct Known Subclasses:
GlowArmorStand
,GlowHumanEntity
,GlowMob
Player
or Monster
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
org.bukkit.entity.Entity.Spigot
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
The LivingEntity's number of ticks since death.protected double
The entity's health.protected double
The entity's max health.protected org.bukkit.util.Vector
The entity's movement as a unit vector, applied each tick according to the entity's speed.protected double
The speed multiplier of the entity.protected final TaskManager
The entity's AI task manager.Fields inherited from class net.glowstone.entity.GlowEntity
active, airDrag, applyDragBeforeAccel, boundingBox, ENTITY_ID_NOBODY, entityId, gravityAccel, liquidDrag, location, metadata, passengerChanged, previousLocation, removed, server, slipMultiplier, teleported, ticksLived, vehicle, velocity, velocityChanged, world, worldLock
-
Constructor Summary
ModifierConstructorDescriptionGlowLivingEntity
(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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addPotionEffect
(org.bukkit.potion.PotionEffect effect) boolean
addPotionEffect
(org.bukkit.potion.PotionEffect effect, boolean force) boolean
addPotionEffects
(Collection<org.bukkit.potion.PotionEffect> effects) void
attack
(@NotNull org.bukkit.entity.Entity entity) boolean
canTakeDamage
(org.bukkit.event.entity.EntityDamageEvent.DamageCause damageCause) Get whether this entity should take damage from the specified source.void
void
List<com.flowpowered.network.Message>
createUpdateMessage
(GlowSession session) Creates aMessage
which can be sent to a client to update this entity.void
damage
(double amount, org.bukkit.entity.Entity source, @NotNull org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) boolean
entityInteract
(GlowPlayer player, InteractEntityMessage message) double
The entity's absorption amount (the amount of health supplementing its max health).org.bukkit.inventory.ItemStack
Collection<org.bukkit.potion.PotionEffect>
protected int
Get the minimal delay until the entity can produce an ambient sound.protected org.bukkit.Sound
Get the ambient sound this entity makes randomly, or null for silence.int
The time in ticks until the next arrow leaves the entity's body.int
The number of arrows in an entity's body.int
The number of arrows stuck inside this entity.@Nullable org.bukkit.attribute.AttributeInstance
getAttribute
(@NotNull org.bukkit.attribute.Attribute attribute) The LivingEntity's AttributeManager.boolean
@NotNull org.bukkit.entity.EntityCategory
protected org.bukkit.Sound
Get the death sound of this entity, or null for silence.int
The LivingEntity's number of ticks since death.org.bukkit.inventory.EntityEquipment
Monitor for the equipment of this entity.double
double
getEyeHeight
(boolean ignoreSneaking) @NotNull org.bukkit.Location
int
float
The head rotation of the living entity, if applicable.double
The entity's health.float
The entity's hurt direction (angle).protected org.bukkit.Sound
Get the hurt sound of this entity, or null for silence.int
org.bukkit.entity.Player
The player that killed this entity, or null if not killed by a player.double
The magnitude of the last damage the entity took.org.bukkit.entity.Entity
The last entity which damaged this living entity.@NotNull List<org.bukkit.block.Block>
getLastTwoTargetBlocks
(Set<org.bukkit.Material> materials, int maxDistance) @NotNull List<org.bukkit.block.Block>
getLineOfSight
(Set<org.bukkit.Material> transparent, int maxDistance) double
int
The maximum amount of air the entity can hold.int
The default length of the invincibility period.<T> T
getMemory
(@NotNull org.bukkit.entity.memory.MemoryKey<T> memoryKey) org.bukkit.util.Vector
The entity's movement as a unit vector, applied each tick according to the entity's speed.int
The number of ticks remaining in the invincibility period.int
The tick that the entity got hit by a player.org.bukkit.potion.PotionEffect
getPotionEffect
(org.bukkit.potion.PotionEffectType potionEffectType) int
How long the entity has until it runs out of air.boolean
int
protected float
The pitch of the sounds this entity makes.protected float
The volume of the sounds this entity makes.double
getSpeed()
The speed multiplier of the entity.getState()
The entity's current AI state.@Nullable org.bukkit.block.Block
getTargetBlock
(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode) @NotNull org.bukkit.block.Block
getTargetBlock
(Set<org.bukkit.Material> materials, int maxDistance) @Nullable org.bukkit.block.Block
getTargetBlockExact
(int maxDistance) @Nullable org.bukkit.block.Block
getTargetBlockExact
(int maxDistance, @NotNull org.bukkit.FluidCollisionMode fluidCollisionMode) @Nullable org.bukkit.block.BlockFace
getTargetBlockFace
(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode) @Nullable com.destroystokyo.paper.block.TargetBlockInfo
getTargetBlockInfo
(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode) @Nullable org.bukkit.entity.Entity
getTargetEntity
(int maxDistance, boolean ignoreBlocks) @Nullable com.destroystokyo.paper.entity.TargetEntityInfo
getTargetEntityInfo
(int maxDistance, boolean ignoreBlocks) The entity's AI task manager.protected org.bukkit.util.Vector
boolean
hasAI()
boolean
hasLineOfSight
(@NotNull org.bukkit.entity.Entity other) boolean
hasPotionEffect
(org.bukkit.potion.PotionEffectType type) boolean
Get whether of not this entity is an arthropod.boolean
Whether entities can collide with this entity.boolean
Whether the entity can automatically glide when falling with an Elytra equipped.boolean
boolean
boolean
Whether the entity is invisible.boolean
boolean
boolean
boolean
boolean
isUndead()
Get whether or not this entity is undead.boolean
Returns whether the entity's eye location is within a solid block.protected void
jump()
<T extends org.bukkit.entity.Projectile>
TlaunchProjectile
(@NotNull Class<? extends T> type) <T extends org.bukkit.entity.Projectile>
TlaunchProjectile
(@NotNull Class<? extends T> type, org.bukkit.util.Vector vector) protected <T extends org.bukkit.entity.Projectile>
TlaunchProjectile
(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>
TlaunchProjectile
(Class<? extends T> type, org.bukkit.util.Vector vector, float offset, float speed) Launches a projectile from this entity.void
playAnimation
(@NotNull org.bukkit.EntityAnimation animation) void
playPickupItemAnimation
(@NotNull org.bukkit.entity.Item item, int quantity) void
pulse()
Called every game cycle.protected void
@Nullable org.bukkit.util.RayTraceResult
rayTraceBlocks
(double maxDistance) @Nullable org.bukkit.util.RayTraceResult
rayTraceBlocks
(double maxDistance, @NotNull org.bukkit.FluidCollisionMode fluidCollisionMode) void
registerAttribute
(@NotNull org.bukkit.attribute.Attribute attribute) void
removePotionEffect
(org.bukkit.potion.PotionEffectType type) void
reset()
Resets the previous location and other properties to their current value.void
void
setAbsorptionAmount
(double absorptionAmount) The entity's absorption amount (the amount of health supplementing its max health).void
setAI
(boolean ai) void
setArrowCooldown
(int arrowCooldown) The time in ticks until the next arrow leaves the entity's body.void
setArrowsInBody
(int arrowsInBody) The number of arrows in an entity's body.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
setHurtDirection
(float hurtDirection) The entity's hurt direction (angle).void
setInvisible
(boolean invisible) Whether the entity is invisible.void
setJumping
(boolean jumping) 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.<T> void
setMemory
(@NotNull org.bukkit.entity.memory.MemoryKey<T> memoryKey, T t) 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
Sets the AI state.void
setSwimming
(boolean swimming) void
void
boolean
Use "Totem of Undying" if equippedprotected void
Methods inherited from class net.glowstone.entity.GlowEntity
addAttachment, addAttachment, addAttachment, addAttachment, addPassenger, addScoreboardTag, collide, createAfterSpawnMessage, createSpawnMessage, customName, customName, damage, damage, damage, eject, equals, fromMobSpawner, getBoundingBox, getCardinalFacing, getChunk, getCustomName, getCustomTags, getDismountLocation, getEffectivePermissions, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getGravityAccel, getHeight, getLastDamageCause, getLeashedEntities, getLeashHolder, getLocation, getLocation, getMaxFireTicks, getMetadata, getMetadata, getMountLocation, getName, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPersistentDataContainer, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasDefaultLandingBehavior, hasFriction, hasGravity, hashCode, hasMetadata, hasMoved, hasPermission, hasPermission, hasRotated, intersects, isCustomNameVisible, isDead, isEmpty, isGlowing, isInBubbleColumn, isInLava, isInMaterial, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isLeashed, isOnGround, isOp, isPermissionSet, isPermissionSet, isPersistent, isRemoved, isSilent, isTeleported, isTicking, isTouchingMaterial, isValid, isWithinDistance, isWithinDistance, leaveVehicle, playEffect, playEffectKnownAndSelf, recalculatePermissions, remove, removeAttachment, removeMetadata, removePassenger, removeScoreboardTag, sendMessage, sendMessage, sendMessage, sendMessage, setAirDrag, setApplyDragBeforeAccel, setBoundingBox, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setFriction, setGlowing, setGravity, setGravityAccel, setInvulnerable, setLastDamageCause, setLeashHolder, setLeashHolderUniqueId, setLiquidDrag, setMetadata, setOp, setPassenger, setPersistent, setPortalCooldown, setRawLocation, setRawLocation, setRotation, setSilent, setSize, setTicksLived, setUniqueId, setVelocity, shouldSave, spigot, teleport, teleport, teleport, teleport, teleportToEnd, teleportToSpawn, toString, updateBoundingBox
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.kyori.adventure.audience.Audience
clearTitle, hideBossBar, openBook, openBook, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, showBossBar, showTitle, stopSound
Methods inherited from interface org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage
Methods inherited from interface org.bukkit.entity.Damageable
damage, damage, damage
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInBubbleColumn, isInLava, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, spigot, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
Methods inherited from interface org.bukkit.entity.LivingEntity
getLeashHolder, getTargetBlock, getTargetBlockFace, getTargetBlockInfo, getTargetEntity, getTargetEntityInfo, isLeashed, playPickupItemAnimation, setLeashHolder
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface org.bukkit.Nameable
customName, customName, getCustomName, setCustomName
Methods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
Methods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Field Details
-
taskManager
The entity's AI task manager. -
health
protected double healthThe entity's health. -
maxHealth
protected double maxHealthThe entity's max health. -
deathTicks
protected int deathTicksThe LivingEntity's number of ticks since death. -
movement
protected org.bukkit.util.Vector movementThe 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.
-
speed
protected double speedThe speed multiplier of the entity.
-
-
Constructor Details
-
GlowLivingEntity
public GlowLivingEntity(org.bukkit.Location location) Creates a mob within the specified world.- Parameters:
location
- The location.
-
GlowLivingEntity
protected GlowLivingEntity(org.bukkit.Location location, double maxHealth) Creates a mob within the specified world.- Parameters:
location
- The location.maxHealth
- The max health of this mob.
-
-
Method Details
-
pulse
public void pulse()Description copied from class:GlowEntity
Called every game cycle. Subclasses should implement this to implement periodic functionality e.g. mob AI.- Overrides:
pulse
in classGlowEntity
-
pulsePhysics
protected void pulsePhysics()- Overrides:
pulsePhysics
in classGlowEntity
-
getVelocityFromMovement
protected org.bukkit.util.Vector getVelocityFromMovement() -
jump
protected void jump() -
isJumping
public boolean isJumping()- Specified by:
isJumping
in interfaceorg.bukkit.entity.LivingEntity
-
setJumping
public void setJumping(boolean jumping) - Specified by:
setJumping
in interfaceorg.bukkit.entity.LivingEntity
-
reset
public void reset()Description copied from class:GlowEntity
Resets the previous location and other properties to their current value.- Overrides:
reset
in classGlowEntity
-
createUpdateMessage
Description copied from class:GlowEntity
Creates aMessage
which can be sent to a client to update this entity.- Overrides:
createUpdateMessage
in classGlowEntity
- Parameters:
session
- Session to update this entity for- Returns:
- A message which can update this entity.
-
getEyeHeight
public double getEyeHeight()- Specified by:
getEyeHeight
in interfaceorg.bukkit.entity.LivingEntity
-
getEyeHeight
public double getEyeHeight(boolean ignoreSneaking) - Specified by:
getEyeHeight
in interfaceorg.bukkit.entity.LivingEntity
-
getEyeLocation
@NotNull public @NotNull org.bukkit.Location getEyeLocation()- Specified by:
getEyeLocation
in interfaceorg.bukkit.entity.LivingEntity
-
hasLineOfSight
public boolean hasLineOfSight(@NotNull @NotNull org.bukkit.entity.Entity other) - Specified by:
hasLineOfSight
in interfaceorg.bukkit.entity.LivingEntity
-
setHeadYaw
public void setHeadYaw(float headYaw) -
getEquipment
public org.bukkit.inventory.EntityEquipment getEquipment()- Specified by:
getEquipment
in interfaceorg.bukkit.entity.LivingEntity
-
setRemainingAir
public void setRemainingAir(int ticks) - Specified by:
setRemainingAir
in interfaceorg.bukkit.entity.LivingEntity
-
setMaximumAir
public void setMaximumAir(int ticks) - Specified by:
setMaximumAir
in interfaceorg.bukkit.entity.LivingEntity
-
getRemoveWhenFarAway
public boolean getRemoveWhenFarAway()- Specified by:
getRemoveWhenFarAway
in interfaceorg.bukkit.entity.LivingEntity
-
getCanPickupItems
public boolean getCanPickupItems()- Specified by:
getCanPickupItems
in interfaceorg.bukkit.entity.LivingEntity
-
getHurtSound
protected org.bukkit.Sound getHurtSound()Get the hurt sound of this entity, or null for silence.- Returns:
- the hurt sound if available
-
getDeathSound
protected org.bukkit.Sound getDeathSound()Get the death sound of this entity, or null for silence.- Returns:
- the death sound if available
-
getAmbientSound
protected org.bukkit.Sound getAmbientSound()Get the ambient sound this entity makes randomly, or null for silence.- Returns:
- the ambient sound if available
-
getAmbientDelay
protected int getAmbientDelay()Get the minimal delay until the entity can produce an ambient sound.- Returns:
- the minimal delay until the entity can produce an ambient sound
-
getSoundVolume
protected float getSoundVolume()The volume of the sounds this entity makes.- Returns:
- the volume of the sounds
-
getSoundPitch
protected float getSoundPitch()The pitch of the sounds this entity makes.- Returns:
- the pitch of the sounds
-
canTakeDamage
public boolean canTakeDamage(org.bukkit.event.entity.EntityDamageEvent.DamageCause damageCause) Get whether this entity should take damage from the specified source.Usually used to check environmental sources such as drowning.
- Parameters:
damageCause
- the damage source to check- Returns:
- whether this entity can take damage from the source
-
isArthropod
public boolean isArthropod()Get whether of not this entity is an arthropod.- Returns:
- true if this entity is an arthropod, false otherwise
-
isUndead
public boolean isUndead()Get whether or not this entity is undead.- Returns:
- true if this entity is undead, false otherwise
-
getLineOfSight
@NotNull public @NotNull List<org.bukkit.block.Block> getLineOfSight(Set<org.bukkit.Material> transparent, int maxDistance) - Specified by:
getLineOfSight
in interfaceorg.bukkit.entity.LivingEntity
-
getTargetBlock
@NotNull public @NotNull org.bukkit.block.Block getTargetBlock(Set<org.bukkit.Material> materials, int maxDistance) - Specified by:
getTargetBlock
in interfaceorg.bukkit.entity.LivingEntity
-
getTargetBlock
@Nullable public @Nullable org.bukkit.block.Block getTargetBlock(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode) - Specified by:
getTargetBlock
in interfaceorg.bukkit.entity.LivingEntity
-
getTargetBlockFace
@Nullable public @Nullable org.bukkit.block.BlockFace getTargetBlockFace(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode) - Specified by:
getTargetBlockFace
in interfaceorg.bukkit.entity.LivingEntity
-
getTargetBlockInfo
@Nullable public @Nullable com.destroystokyo.paper.block.TargetBlockInfo getTargetBlockInfo(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode) - Specified by:
getTargetBlockInfo
in interfaceorg.bukkit.entity.LivingEntity
-
getTargetEntity
@Nullable public @Nullable org.bukkit.entity.Entity getTargetEntity(int maxDistance, boolean ignoreBlocks) - Specified by:
getTargetEntity
in interfaceorg.bukkit.entity.LivingEntity
-
getTargetEntityInfo
@Nullable public @Nullable com.destroystokyo.paper.entity.TargetEntityInfo getTargetEntityInfo(int maxDistance, boolean ignoreBlocks) - Specified by:
getTargetEntityInfo
in interfaceorg.bukkit.entity.LivingEntity
-
getTargetBlockExact
@Nullable public @Nullable org.bukkit.block.Block getTargetBlockExact(int maxDistance) - Specified by:
getTargetBlockExact
in interfaceorg.bukkit.entity.LivingEntity
-
getTargetBlockExact
@Nullable public @Nullable org.bukkit.block.Block getTargetBlockExact(int maxDistance, @NotNull @NotNull org.bukkit.FluidCollisionMode fluidCollisionMode) - Specified by:
getTargetBlockExact
in interfaceorg.bukkit.entity.LivingEntity
-
rayTraceBlocks
@Nullable public @Nullable org.bukkit.util.RayTraceResult rayTraceBlocks(double maxDistance) - Specified by:
rayTraceBlocks
in interfaceorg.bukkit.entity.LivingEntity
-
rayTraceBlocks
@Nullable public @Nullable org.bukkit.util.RayTraceResult rayTraceBlocks(double maxDistance, @NotNull @NotNull org.bukkit.FluidCollisionMode fluidCollisionMode) - Specified by:
rayTraceBlocks
in interfaceorg.bukkit.entity.LivingEntity
-
getLastTwoTargetBlocks
@NotNull public @NotNull List<org.bukkit.block.Block> getLastTwoTargetBlocks(Set<org.bukkit.Material> materials, int maxDistance) - Specified by:
getLastTwoTargetBlocks
in interfaceorg.bukkit.entity.LivingEntity
-
isWithinSolidBlock
public boolean isWithinSolidBlock()Returns whether the entity's eye location is within a solid block.- Returns:
- true if the entity is in a solid block; false otherwise
-
launchProjectile
@NotNull public <T extends org.bukkit.entity.Projectile> T launchProjectile(@NotNull @NotNull Class<? extends T> type) - Specified by:
launchProjectile
in interfaceorg.bukkit.projectiles.ProjectileSource
-
launchProjectile
@NotNull public <T extends org.bukkit.entity.Projectile> T launchProjectile(@NotNull @NotNull Class<? extends T> type, org.bukkit.util.Vector vector) - Specified by:
launchProjectile
in interfaceorg.bukkit.projectiles.ProjectileSource
-
launchProjectile
public <T extends org.bukkit.entity.Projectile> T launchProjectile(Class<? extends T> type, org.bukkit.util.Vector vector, float offset, float speed) Launches a projectile from this entity.- Type Parameters:
T
- the projectile class- Parameters:
type
- the projectile classvector
- the direction to shoot inoffset
- TODO: document this parameterspeed
- the speed for the first flight tick- Returns:
- the launched projectile
-
launchProjectile
protected <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) Launches a projectile from this entity in the horizontal direction it is facing, relative to the given velocity vector.- Type Parameters:
T
- the projectile class- Parameters:
type
- 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 tick- Returns:
- the launched projectile
-
setHealth
public void setHealth(double health) - Specified by:
setHealth
in interfaceorg.bukkit.entity.Damageable
-
damage
public void damage(double amount, org.bukkit.entity.Entity source, @NotNull @NotNull org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) - Specified by:
damage
in interfaceorg.bukkit.entity.Damageable
- Overrides:
damage
in classGlowEntity
-
getMaxHealth
public double getMaxHealth()- Specified by:
getMaxHealth
in interfaceorg.bukkit.entity.Damageable
-
setMaxHealth
public void setMaxHealth(double health) - Specified by:
setMaxHealth
in interfaceorg.bukkit.entity.Damageable
-
resetMaxHealth
public void resetMaxHealth()- Specified by:
resetMaxHealth
in interfaceorg.bukkit.entity.Damageable
-
addPotionEffect
public boolean addPotionEffect(org.bukkit.potion.PotionEffect effect) - Specified by:
addPotionEffect
in interfaceorg.bukkit.entity.LivingEntity
-
addPotionEffect
public boolean addPotionEffect(org.bukkit.potion.PotionEffect effect, boolean force) - Specified by:
addPotionEffect
in interfaceorg.bukkit.entity.LivingEntity
-
addPotionEffects
- Specified by:
addPotionEffects
in interfaceorg.bukkit.entity.LivingEntity
-
hasPotionEffect
public boolean hasPotionEffect(org.bukkit.potion.PotionEffectType type) - Specified by:
hasPotionEffect
in interfaceorg.bukkit.entity.LivingEntity
-
getPotionEffect
public org.bukkit.potion.PotionEffect getPotionEffect(org.bukkit.potion.PotionEffectType potionEffectType) - Specified by:
getPotionEffect
in interfaceorg.bukkit.entity.LivingEntity
-
removePotionEffect
public void removePotionEffect(org.bukkit.potion.PotionEffectType type) - Specified by:
removePotionEffect
in interfaceorg.bukkit.entity.LivingEntity
-
getActivePotionEffects
- Specified by:
getActivePotionEffects
in interfaceorg.bukkit.entity.LivingEntity
-
clearActivePotionEffects
public void clearActivePotionEffects() -
updatePotionEffectsMetadata
protected void updatePotionEffectsMetadata() -
setOnGround
public void setOnGround(boolean onGround) Description copied from class:GlowEntity
Sets the on-ground flag and clears fall distance.- Overrides:
setOnGround
in classGlowEntity
- Parameters:
onGround
- true if this entity is now on the ground; false otherwise
-
isGliding
public boolean isGliding()- Specified by:
isGliding
in interfaceorg.bukkit.entity.LivingEntity
-
setGliding
public void setGliding(boolean gliding) - Specified by:
setGliding
in interfaceorg.bukkit.entity.LivingEntity
-
getShieldBlockingDelay
public int getShieldBlockingDelay()- Specified by:
getShieldBlockingDelay
in interfaceorg.bukkit.entity.LivingEntity
-
setShieldBlockingDelay
public void setShieldBlockingDelay(int delay) - Specified by:
setShieldBlockingDelay
in interfaceorg.bukkit.entity.LivingEntity
-
getActiveItem
public org.bukkit.inventory.ItemStack getActiveItem()- Specified by:
getActiveItem
in interfaceorg.bukkit.entity.LivingEntity
-
clearActiveItem
public void clearActiveItem()- Specified by:
clearActiveItem
in interfaceorg.bukkit.entity.LivingEntity
-
getItemUseRemainingTime
public int getItemUseRemainingTime()- Specified by:
getItemUseRemainingTime
in interfaceorg.bukkit.entity.LivingEntity
-
getHandRaisedTime
public int getHandRaisedTime()- Specified by:
getHandRaisedTime
in interfaceorg.bukkit.entity.LivingEntity
-
isHandRaised
public boolean isHandRaised()- Specified by:
isHandRaised
in interfaceorg.bukkit.entity.LivingEntity
-
isSwimming
public boolean isSwimming()- Specified by:
isSwimming
in interfaceorg.bukkit.entity.LivingEntity
-
setSwimming
public void setSwimming(boolean swimming) - Specified by:
setSwimming
in interfaceorg.bukkit.entity.LivingEntity
-
isRiptiding
public boolean isRiptiding()- Specified by:
isRiptiding
in interfaceorg.bukkit.entity.LivingEntity
-
isSleeping
public boolean isSleeping()- Specified by:
isSleeping
in interfaceorg.bukkit.entity.LivingEntity
-
setState
Sets the AI state.- Parameters:
state
- the new AI state
-
setAI
public void setAI(boolean ai) - Specified by:
setAI
in interfaceorg.bukkit.entity.LivingEntity
-
hasAI
public boolean hasAI()- Specified by:
hasAI
in interfaceorg.bukkit.entity.LivingEntity
-
attack
public void attack(@NotNull @NotNull org.bukkit.entity.Entity entity) - Specified by:
attack
in interfaceorg.bukkit.entity.LivingEntity
-
swingMainHand
public void swingMainHand()- Specified by:
swingMainHand
in interfaceorg.bukkit.entity.LivingEntity
-
swingOffHand
public void swingOffHand()- Specified by:
swingOffHand
in interfaceorg.bukkit.entity.LivingEntity
-
getCollidableExemptions
- Specified by:
getCollidableExemptions
in interfaceorg.bukkit.entity.LivingEntity
-
getMemory
@Nullable public <T> T getMemory(@NotNull @NotNull org.bukkit.entity.memory.MemoryKey<T> memoryKey) - Specified by:
getMemory
in interfaceorg.bukkit.entity.LivingEntity
-
setMemory
public <T> void setMemory(@NotNull @NotNull org.bukkit.entity.memory.MemoryKey<T> memoryKey, @Nullable T t) - Specified by:
setMemory
in interfaceorg.bukkit.entity.LivingEntity
-
getCategory
@NotNull public @NotNull org.bukkit.entity.EntityCategory getCategory()- Specified by:
getCategory
in interfaceorg.bukkit.entity.LivingEntity
-
playAnimation
public void playAnimation(@NotNull @NotNull org.bukkit.EntityAnimation animation) - Specified by:
playAnimation
in interfaceorg.bukkit.entity.LivingEntity
-
getAttribute
@Nullable public @Nullable org.bukkit.attribute.AttributeInstance getAttribute(@NotNull @NotNull org.bukkit.attribute.Attribute attribute) - Specified by:
getAttribute
in interfaceorg.bukkit.attribute.Attributable
-
registerAttribute
public void registerAttribute(@NotNull @NotNull org.bukkit.attribute.Attribute attribute) - Specified by:
registerAttribute
in interfaceorg.bukkit.attribute.Attributable
-
entityInteract
- Overrides:
entityInteract
in classGlowEntity
-
tryUseTotem
public boolean tryUseTotem()Use "Totem of Undying" if equipped- Returns:
- result of totem use
-
playPickupItemAnimation
public void playPickupItemAnimation(@NotNull @NotNull org.bukkit.entity.Item item, int quantity) - Specified by:
playPickupItemAnimation
in interfaceorg.bukkit.entity.LivingEntity
-
getTaskManager
The entity's AI task manager. -
getAttributeManager
The LivingEntity's AttributeManager. -
getHealth
public double getHealth()The entity's health.- Specified by:
getHealth
in interfaceorg.bukkit.entity.Damageable
-
getDeathTicks
public int getDeathTicks()The LivingEntity's number of ticks since death. -
getMovement
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.
-
setMovement
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.
-
getSpeed
public double getSpeed()The speed multiplier of the entity. -
setSpeed
public void setSpeed(double speed) The speed multiplier of the entity. -
getKiller
public org.bukkit.entity.Player getKiller()The player that killed this entity, or null if not killed by a player.- Specified by:
getKiller
in interfaceorg.bukkit.entity.LivingEntity
-
setKiller
public void setKiller(org.bukkit.entity.Player killer) The player that killed this entity, or null if not killed by a player.- Specified by:
setKiller
in interfaceorg.bukkit.entity.LivingEntity
-
getPlayerDamageTick
public int getPlayerDamageTick()The tick that the entity got hit by a player. The default value was set to -101 rather than 0. -
setPlayerDamageTick
public void setPlayerDamageTick(int playerDamageTick) The tick that the entity got hit by a player. The default value was set to -101 rather than 0. -
isCollidable
public boolean isCollidable()Whether entities can collide with this entity.- Specified by:
isCollidable
in interfaceorg.bukkit.entity.LivingEntity
-
setCollidable
public void setCollidable(boolean collidable) Whether entities can collide with this entity.- Specified by:
setCollidable
in interfaceorg.bukkit.entity.LivingEntity
-
getArrowsStuck
public int getArrowsStuck()The number of arrows stuck inside this entity.- Specified by:
getArrowsStuck
in interfaceorg.bukkit.entity.LivingEntity
-
setArrowsStuck
public void setArrowsStuck(int arrowsStuck) The number of arrows stuck inside this entity.- Specified by:
setArrowsStuck
in interfaceorg.bukkit.entity.LivingEntity
-
getArrowsInBody
public int getArrowsInBody()The number of arrows in an entity's body.
TODO: Investigate difference between this and `arrowsStuck`.- Specified by:
getArrowsInBody
in interfaceorg.bukkit.entity.LivingEntity
-
setArrowsInBody
public void setArrowsInBody(int arrowsInBody) The number of arrows in an entity's body.
TODO: Investigate difference between this and `arrowsStuck`.- Specified by:
setArrowsInBody
in interfaceorg.bukkit.entity.LivingEntity
-
getArrowCooldown
public int getArrowCooldown()The time in ticks until the next arrow leaves the entity's body.- Specified by:
getArrowCooldown
in interfaceorg.bukkit.entity.LivingEntity
-
setArrowCooldown
public void setArrowCooldown(int arrowCooldown) The time in ticks until the next arrow leaves the entity's body.- Specified by:
setArrowCooldown
in interfaceorg.bukkit.entity.LivingEntity
-
getAbsorptionAmount
public double getAbsorptionAmount()The entity's absorption amount (the amount of health supplementing its max health).- Specified by:
getAbsorptionAmount
in interfaceorg.bukkit.entity.Damageable
-
setAbsorptionAmount
public void setAbsorptionAmount(double absorptionAmount) The entity's absorption amount (the amount of health supplementing its max health).- Specified by:
setAbsorptionAmount
in interfaceorg.bukkit.entity.Damageable
-
isInvisible
public boolean isInvisible()Whether the entity is invisible.- Specified by:
isInvisible
in interfaceorg.bukkit.entity.LivingEntity
-
setInvisible
public void setInvisible(boolean invisible) Whether the entity is invisible.- Specified by:
setInvisible
in interfaceorg.bukkit.entity.LivingEntity
-
getHurtDirection
public float getHurtDirection()The entity's hurt direction (angle).- Specified by:
getHurtDirection
in interfaceorg.bukkit.entity.LivingEntity
-
setHurtDirection
public void setHurtDirection(float hurtDirection) The entity's hurt direction (angle).- Specified by:
setHurtDirection
in interfaceorg.bukkit.entity.LivingEntity
-
getLastDamage
public double getLastDamage()The magnitude of the last damage the entity took.- Specified by:
getLastDamage
in interfaceorg.bukkit.entity.LivingEntity
-
setLastDamage
public void setLastDamage(double lastDamage) The magnitude of the last damage the entity took.- Specified by:
setLastDamage
in interfaceorg.bukkit.entity.LivingEntity
-
getRemainingAir
public int getRemainingAir()How long the entity has until it runs out of air.- Specified by:
getRemainingAir
in interfaceorg.bukkit.entity.LivingEntity
-
getMaximumAir
public int getMaximumAir()The maximum amount of air the entity can hold.- Specified by:
getMaximumAir
in interfaceorg.bukkit.entity.LivingEntity
-
getNoDamageTicks
public int getNoDamageTicks()The number of ticks remaining in the invincibility period.- Specified by:
getNoDamageTicks
in interfaceorg.bukkit.entity.LivingEntity
-
setNoDamageTicks
public void setNoDamageTicks(int noDamageTicks) The number of ticks remaining in the invincibility period.- Specified by:
setNoDamageTicks
in interfaceorg.bukkit.entity.LivingEntity
-
getMaximumNoDamageTicks
public int getMaximumNoDamageTicks()The default length of the invincibility period.- Specified by:
getMaximumNoDamageTicks
in interfaceorg.bukkit.entity.LivingEntity
-
setMaximumNoDamageTicks
public void setMaximumNoDamageTicks(int maximumNoDamageTicks) The default length of the invincibility period.- Specified by:
setMaximumNoDamageTicks
in interfaceorg.bukkit.entity.LivingEntity
-
setRemoveWhenFarAway
public void setRemoveWhenFarAway(boolean removeWhenFarAway) Whether the entity should be removed if it is too distant from players.- Specified by:
setRemoveWhenFarAway
in interfaceorg.bukkit.entity.LivingEntity
-
setCanPickupItems
public void setCanPickupItems(boolean canPickupItems) Whether the (non-Player) entity can pick up armor and tools.- Specified by:
setCanPickupItems
in interfaceorg.bukkit.entity.LivingEntity
-
getEquipmentMonitor
Monitor for the equipment of this entity. -
isFallFlying
public boolean isFallFlying()Whether the entity can automatically glide when falling with an Elytra equipped. This value is ignored for players. -
setFallFlying
public void setFallFlying(boolean fallFlying) Whether the entity can automatically glide when falling with an Elytra equipped. This value is ignored for players. -
getLastDamager
public org.bukkit.entity.Entity getLastDamager()The last entity which damaged this living entity. -
setLastDamager
public void setLastDamager(org.bukkit.entity.Entity lastDamager) The last entity which damaged this living entity. -
getHeadYaw
public float getHeadYaw()The head rotation of the living entity, if applicable. -
getState
The entity's current AI state.
-