Package net.glowstone.entity
Class GlowEntity
java.lang.Object
net.glowstone.entity.GlowEntity
- All Implemented Interfaces:
net.kyori.adventure.audience.Audience
,net.kyori.adventure.pointer.Pointered
,net.kyori.adventure.sound.Sound.Emitter
,net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>
,org.bukkit.command.CommandSender
,org.bukkit.entity.Entity
,org.bukkit.metadata.Metadatable
,org.bukkit.Nameable
,org.bukkit.permissions.Permissible
,org.bukkit.permissions.ServerOperator
,org.bukkit.persistence.PersistentDataHolder
- Direct Known Subclasses:
GlowAreaEffectCloud
,GlowEnderCrystal
,GlowEnderDragonPart
,GlowEvokerFangs
,GlowExperienceOrb
,GlowExplosive
,GlowFallingBlock
,GlowFirework
,GlowHangingEntity
,GlowItem
,GlowLightningStrike
,GlowLivingEntity
,GlowProjectile
,GlowVehicle
Represents some entity in the world such as an item on the floor or a player.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
org.bukkit.entity.Entity.Spigot
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
A flag indicating if this entity is currently active.protected double
Velocity reduction applied each tick in air.protected boolean
If drag is applied before appling acceleration while calculating physics.protected EntityBoundingBox
The entity's bounding box, or null if it has no physical presence.static final int
An ID to use in network messages when the protocol calls for a 32-bit entity ID, but the relevant Object doesn't exist, isn't an Entity, or is in a different World (and thus a different space for 32-bit entity IDs).protected int
This entity's current identifier for its world.protected org.bukkit.util.Vector
Gravity acceleration applied each tick.protected double
Velocity reduction applied each tick in water.protected final org.bukkit.Location
The current position.protected final MetadataMap
The entity's metadata.protected boolean
protected final org.bukkit.Location
The position in the last cycle.protected boolean
Whether this entity was forcibly removed from the world.protected final GlowServer
The server this entity belongs to.protected double
The slipperiness multiplier applied according to the block this entity was on.protected boolean
Whether the entity should have its position resent as if teleported.protected int
A counter of how long this entity has existed.protected GlowEntity
The entity this entity is currently riding.protected final org.bukkit.util.Vector
The entity's velocity, applied each tick.protected boolean
Whether the entity should have its velocity resent.protected GlowWorld
The world this entity belongs to.protected final ReadWriteLock
Lock to prevent concurrent modifications affected by switching worlds. -
Constructor Summary
ConstructorsConstructorDescriptionGlowEntity
(org.bukkit.Location location) Creates an entity and adds it to the specified world. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.permissions.PermissionAttachment
addAttachment
(org.bukkit.plugin.Plugin plugin) org.bukkit.permissions.PermissionAttachment
addAttachment
(org.bukkit.plugin.Plugin plugin, int i) org.bukkit.permissions.PermissionAttachment
addAttachment
(org.bukkit.plugin.Plugin plugin, String s, boolean b) org.bukkit.permissions.PermissionAttachment
addAttachment
(org.bukkit.plugin.Plugin plugin, String s, boolean b, int i) boolean
addPassenger
(org.bukkit.entity.Entity passenger) boolean
addScoreboardTag
(String tag) void
collide
(org.bukkit.block.Block block) Collide with the target block.List<com.flowpowered.network.Message>
createAfterSpawnMessage
(GlowSession session) Creates a List ofMessage
which can be sent to a client directly after the entity is spawned.abstract List<com.flowpowered.network.Message>
Creates a list ofMessage
s which can be sent to a client to spawn this entity.List<com.flowpowered.network.Message>
createUpdateMessage
(GlowSession session) Creates aMessage
which can be sent to a client to update this entity.@Nullable net.kyori.adventure.text.Component
void
customName
(@Nullable net.kyori.adventure.text.Component component) void
damage
(double amount) void
damage
(double amount, org.bukkit.entity.Entity source) void
damage
(double amount, org.bukkit.entity.Entity source, @NotNull org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) void
damage
(double amount, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) boolean
eject()
boolean
entityInteract
(GlowPlayer player, InteractEntityMessage message) boolean
boolean
@NotNull org.bukkit.util.BoundingBox
org.bukkit.block.BlockFace
Get the direction (SOUTH, WEST, NORTH, or EAST) this entity is facing.org.bukkit.Chunk
getChunk()
List of custom String data for the entity.org.bukkit.Location
Set<org.bukkit.permissions.PermissionAttachmentInfo>
int
This entity's current identifier for its world.@NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason
org.bukkit.block.BlockFace
Gets the full direction (including SOUTH_SOUTH_EAST etc) this entity is facing.float
The distance the entity is currently falling without touching the ground.int
How long the entity has been on fire, or 0 if it is not.int
org.bukkit.util.Vector
Returns the change in velocity per physics tick due to gravity.double
org.bukkit.event.entity.EntityDamageEvent
An EntityDamageEvent representing the last damage cause on this entity.All entities that currently have this entity as leash holder.@NotNull org.bukkit.entity.Entity
Gets the entity that is currently leading this entity.@NotNull org.bukkit.Location
org.bukkit.Location
getLocation
(org.bukkit.Location loc) int
int
List<org.bukkit.metadata.MetadataValue>
getMetadata
(String metadataKey) org.bukkit.Location
getName()
List<org.bukkit.entity.Entity>
getNearbyEntities
(double x, double y, double z) org.bukkit.Location
The original location of this entity.org.bukkit.entity.Entity
List<org.bukkit.entity.Entity>
@NotNull org.bukkit.persistence.PersistentDataContainer
org.bukkit.block.PistonMoveReaction
int
The Nether portal cooldown for the entity.@NotNull org.bukkit.entity.Pose
getPose()
The server this entity belongs to.@NotNull org.bukkit.entity.SpawnCategory
int
A counter of how long this entity has existed.@NotNull Set<org.bukkit.entity.Player>
org.bukkit.entity.EntityType
getType()
The entity this entity is currently riding.org.bukkit.util.Vector
double
getWidth()
getWorld()
The world this entity belongs to.protected boolean
If true,setRawLocation(Location, boolean)
withfall
true will callsetOnGround(boolean)
according to whether or not our location is inside a solid block.boolean
boolean
int
hashCode()
boolean
hasMetadata
(String metadataKey) boolean
hasMoved()
Checks if this entity has moved this cycle.boolean
boolean
hasPermission
(org.bukkit.permissions.Permission permission) boolean
Checks if this entity has rotated this cycle.boolean
intersects
(BoundingBox box) boolean
boolean
isDead()
boolean
isEmpty()
boolean
boolean
isFrozen()
boolean
boolean
boolean
isInLava()
boolean
isInMaterial
(org.bukkit.Material type) boolean
boolean
isInRain()
boolean
boolean
Whether this entity is invulnerable.boolean
boolean
boolean
boolean
boolean
boolean
A flag indicting if the entity is on the ground.boolean
isOp()
Whether this entity has operator permissions.boolean
boolean
isPermissionSet
(org.bukkit.permissions.Permission permission) boolean
boolean
Whether this entity was forcibly removed from the world.boolean
isSilent()
boolean
Whether the entity should have its position resent as if teleported.boolean
boolean
isTouchingMaterial
(org.bukkit.Material material) Determine if this entity is intersecting a block of the specified type.boolean
isValid()
boolean
boolean
isWithinDistance
(GlowEntity other) Checks if this entity is within the visible radius of another.boolean
isWithinDistance
(org.bukkit.Location loc) Checks if this entity is within the visible radius of a location.boolean
void
lockFreezeTicks
(boolean locked) @NotNull net.kyori.adventure.text.Component
name()
void
playEffect
(org.bukkit.EntityEffect type) void
playEffectKnownAndSelf
(org.bukkit.EntityEffect type) void
pulse()
Called every game cycle.protected void
void
void
remove()
Destroys this entity by removing it from the world and marking it as not being active.void
removeAttachment
(org.bukkit.permissions.PermissionAttachment permissionAttachment) void
removeMetadata
(String metadataKey, org.bukkit.plugin.Plugin owningPlugin) boolean
removePassenger
(org.bukkit.entity.Entity passenger) boolean
void
reset()
Resets the previous location and other properties to their current value.void
sendMessage
(@Nullable UUID sender, @NotNull String message) void
sendMessage
(@Nullable UUID sender, @NotNull String[] messages) void
sendMessage
(String message) void
sendMessage
(String[] strings) void
setAirDrag
(double airDrag) Velocity reduction applied each tick in air.void
setApplyDragBeforeAccel
(boolean applyDragBeforeAccel) If drag is applied before appling acceleration while calculating physics.protected final void
setBoundingBox
(double xz, double y) void
setCustomName
(String name) void
setCustomNameVisible
(boolean flag) void
setFallDistance
(float distance) void
setFireTicks
(int fireTicks) How long the entity has been on fire, or 0 if it is not.void
setFreezeTicks
(int ticks) void
setFriction
(boolean friction) Whether friction applies to the entity.void
setGlowing
(boolean glowing) void
setGravity
(boolean gravity) Whether gravity applies to the entity.void
setGravityAccel
(org.bukkit.util.Vector gravityAccel) Gravity acceleration applied each tick.void
setInvulnerable
(boolean invulnerable) Whether this entity is invulnerable.void
setLastDamageCause
(org.bukkit.event.entity.EntityDamageEvent lastDamageCause) An EntityDamageEvent representing the last damage cause on this entity.boolean
setLeashHolder
(org.bukkit.entity.Entity holder) Sets the leash on this entity to be held by the supplied entity.void
setLeashHolderUniqueId
(UUID uniqueId) Set the unique ID of this entities leash holder.void
setLiquidDrag
(double liquidDrag) Velocity reduction applied each tick in water.void
setMetadata
(String metadataKey, org.bukkit.metadata.MetadataValue newMetadataValue) void
setOnGround
(boolean onGround) Sets the on-ground flag and clears fall distance.void
setOp
(boolean op) Whether this entity has operator permissions.boolean
setPassenger
(org.bukkit.entity.Entity newPassenger) void
setPersistent
(boolean persistent) void
setPortalCooldown
(int portalCooldown) The Nether portal cooldown for the entity.void
setRawLocation
(org.bukkit.Location location) Sets this entity's location and applies fall damage calculations.void
setRawLocation
(org.bukkit.Location location, boolean fall) Sets this entity's location.void
setRotation
(float yaw, float pitch) void
setSilent
(boolean silent) protected void
setSize
(float xz, float y) void
setTicksLived
(int ticksLived) A counter of how long this entity has existed.void
setUniqueId
(UUID uuid) Sets this entity's unique identifier if possible.void
setVelocity
(org.bukkit.util.Vector velocity) void
setVisualFire
(boolean fire) boolean
Checks whether this entity should be saved as part of the world.boolean
spawnAt
(@NotNull org.bukkit.Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) @NotNull org.bukkit.entity.Entity.Spigot
spigot()
@NotNull net.kyori.adventure.text.Component
boolean
teleport
(org.bukkit.entity.Entity destination) boolean
teleport
(org.bukkit.entity.Entity destination, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) boolean
teleport
(org.bukkit.Location location) boolean
teleport
(org.bukkit.Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) protected boolean
Teleport this entity to the End.protected boolean
Teleport this entity to the spawn point of the main world.toString()
protected void
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, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
Methods inherited from interface org.bukkit.command.CommandSender
sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage
Methods inherited from interface org.bukkit.entity.Entity
asHoverEvent, spawnAt, teleportAsync, teleportAsync
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
Methods inherited from interface org.bukkit.permissions.Permissible
permissionValue, permissionValue
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
-
Field Details
-
ENTITY_ID_NOBODY
public static final int ENTITY_ID_NOBODYAn ID to use in network messages when the protocol calls for a 32-bit entity ID, but the relevant Object doesn't exist, isn't an Entity, or is in a different World (and thus a different space for 32-bit entity IDs).- See Also:
-
server
The server this entity belongs to. -
metadata
The entity's metadata. -
location
protected final org.bukkit.Location locationThe current position. -
previousLocation
protected final org.bukkit.Location previousLocationThe position in the last cycle. -
velocity
protected final org.bukkit.util.Vector velocityThe entity's velocity, applied each tick. -
worldLock
Lock to prevent concurrent modifications affected by switching worlds. -
world
The world this entity belongs to. Guarded byworldLock
. -
active
protected boolean activeA flag indicating if this entity is currently active. -
entityId
protected int entityIdThis entity's current identifier for its world. -
teleported
protected boolean teleportedWhether the entity should have its position resent as if teleported. -
velocityChanged
protected boolean velocityChangedWhether the entity should have its velocity resent. -
ticksLived
protected int ticksLivedA counter of how long this entity has existed. -
vehicle
The entity this entity is currently riding. -
boundingBox
The entity's bounding box, or null if it has no physical presence. -
passengerChanged
protected boolean passengerChanged -
removed
protected boolean removedWhether this entity was forcibly removed from the world. -
airDrag
protected double airDragVelocity reduction applied each tick in air. For example, if the multiplier is 0.98, the entity will lose 2% of its velocity each physics tick. The default value 1 indicates no air drag. -
liquidDrag
protected double liquidDragVelocity reduction applied each tick in water. For example, if the multiplier is 0.98, the entity will lose 2% of its velocity each physics tick. The default value 0.8 indicates 20% water drag. -
gravityAccel
protected org.bukkit.util.Vector gravityAccelGravity acceleration applied each tick. The default value (0,0,0) indicates no gravity acceleration. -
slipMultiplier
protected double slipMultiplierThe slipperiness multiplier applied according to the block this entity was on. -
applyDragBeforeAccel
protected boolean applyDragBeforeAccelIf drag is applied before appling acceleration while calculating physics.
-
-
Constructor Details
-
GlowEntity
public GlowEntity(org.bukkit.Location location) Creates an entity and adds it to the specified world.- Parameters:
location
- The location of the entity.
-
-
Method Details
-
toString
-
sendMessage
- Specified by:
sendMessage
in interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessage
in interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessage
in interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessage
in interfaceorg.bukkit.command.CommandSender
-
getName
- Specified by:
getName
in interfaceorg.bukkit.command.CommandSender
-
getUniqueId
- Specified by:
getUniqueId
in interfaceorg.bukkit.entity.Entity
-
setUniqueId
Sets this entity's unique identifier if possible.- Parameters:
uuid
- The new UUID. Must not be null.- Throws:
IllegalArgumentException
- if the passed UUID is null.IllegalStateException
- if a UUID has already been set.
-
isDead
public boolean isDead()- Specified by:
isDead
in interfaceorg.bukkit.entity.Entity
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceorg.bukkit.entity.Entity
-
getLocation
@NotNull public @NotNull org.bukkit.Location getLocation()- Specified by:
getLocation
in interfaceorg.bukkit.entity.Entity
-
getLocation
public org.bukkit.Location getLocation(org.bukkit.Location loc) - Specified by:
getLocation
in interfaceorg.bukkit.entity.Entity
-
getChunk
public org.bukkit.Chunk getChunk()- Specified by:
getChunk
in interfaceorg.bukkit.entity.Entity
-
getEntitySpawnReason
public @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason()- Specified by:
getEntitySpawnReason
in interfaceorg.bukkit.entity.Entity
-
getCardinalFacing
public org.bukkit.block.BlockFace getCardinalFacing()Get the direction (SOUTH, WEST, NORTH, or EAST) this entity is facing.- Returns:
- The cardinal BlockFace of this entity.
-
getFacing
public org.bukkit.block.BlockFace getFacing()Gets the full direction (including SOUTH_SOUTH_EAST etc) this entity is facing.- Specified by:
getFacing
in interfaceorg.bukkit.entity.Entity
- Returns:
- The intercardinal BlockFace of this entity
-
getPose
@NotNull public @NotNull org.bukkit.entity.Pose getPose()- Specified by:
getPose
in interfaceorg.bukkit.entity.Entity
-
getSpawnCategory
@NotNull public @NotNull org.bukkit.entity.SpawnCategory getSpawnCategory()- Specified by:
getSpawnCategory
in interfaceorg.bukkit.entity.Entity
-
spigot
@NotNull public @NotNull org.bukkit.entity.Entity.Spigot spigot()- Specified by:
spigot
in interfaceorg.bukkit.command.CommandSender
- Specified by:
spigot
in interfaceorg.bukkit.entity.Entity
-
name
@NotNull public @NotNull net.kyori.adventure.text.Component name()- Specified by:
name
in interfaceorg.bukkit.command.CommandSender
-
teamDisplayName
@NotNull public @NotNull net.kyori.adventure.text.Component teamDisplayName()- Specified by:
teamDisplayName
in interfaceorg.bukkit.entity.Entity
-
getVelocity
public org.bukkit.util.Vector getVelocity()- Specified by:
getVelocity
in interfaceorg.bukkit.entity.Entity
-
setVelocity
public void setVelocity(org.bukkit.util.Vector velocity) - Specified by:
setVelocity
in interfaceorg.bukkit.entity.Entity
-
getGravityAccel
public org.bukkit.util.Vector getGravityAccel()Returns the change in velocity per physics tick due to gravity.- Returns:
- the change in velocity per physics tick due to gravity
-
teleport
public boolean teleport(org.bukkit.Location location) - Specified by:
teleport
in interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.entity.Entity destination) - Specified by:
teleport
in interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) - Specified by:
teleport
in interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.entity.Entity destination, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) - Specified by:
teleport
in interfaceorg.bukkit.entity.Entity
-
isWithinDistance
Checks if this entity is within the visible radius of another.- Parameters:
other
- The other entity.- Returns:
true
if the entities can see each other,false
if not.
-
isWithinDistance
public boolean isWithinDistance(org.bukkit.Location loc) Checks if this entity is within the visible radius of a location.- Parameters:
loc
- The location.- Returns:
true
if the entities can see each other,false
if not.
-
shouldSave
public boolean shouldSave()Checks whether this entity should be saved as part of the world.- Returns:
- True if the entity should be saved.
-
isTicking
public boolean isTicking()- Specified by:
isTicking
in interfaceorg.bukkit.entity.Entity
-
getTrackedPlayers
- Specified by:
getTrackedPlayers
in interfaceorg.bukkit.entity.Entity
-
spawnAt
public boolean spawnAt(@NotNull @NotNull org.bukkit.Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) - Specified by:
spawnAt
in interfaceorg.bukkit.entity.Entity
-
isInPowderedSnow
public boolean isInPowderedSnow()- Specified by:
isInPowderedSnow
in interfaceorg.bukkit.entity.Entity
-
pulse
public void pulse()Called every game cycle. Subclasses should implement this to implement periodic functionality e.g. mob AI. -
reset
public void reset()Resets the previous location and other properties to their current value. -
setRawLocation
public void setRawLocation(org.bukkit.Location location, boolean fall) Sets this entity's location.- Parameters:
location
- The new location.fall
- Whether to calculate fall damage or not.
-
setRawLocation
public void setRawLocation(org.bukkit.Location location) Sets this entity's location and applies fall damage calculations.- Parameters:
location
- The new location.
-
hasDefaultLandingBehavior
protected boolean hasDefaultLandingBehavior()If true,setRawLocation(Location, boolean)
withfall
true will callsetOnGround(boolean)
according to whether or not our location is inside a solid block.- Returns:
- true to call
setOnGround(boolean)
fromsetRawLocation(Location, boolean)
; false otherwise
-
createSpawnMessage
Creates a list ofMessage
s which can be sent to a client to spawn this entity. Implementations in concrete subclasses may return a shallowly immutable list.- Returns:
- A list of messages which can spawn this entity.
-
createAfterSpawnMessage
Creates a List ofMessage
which can be sent to a client directly after the entity is spawned.- Parameters:
session
- Session to update this entity for- Returns:
- A message which can spawn this entity.
-
createUpdateMessage
Creates aMessage
which can be sent to a client to update this entity.- Parameters:
session
- Session to update this entity for- Returns:
- A message which can update this entity.
-
hasMoved
public boolean hasMoved()Checks if this entity has moved this cycle.- Returns:
true
if so,false
if not.
-
hasRotated
public boolean hasRotated()Checks if this entity has rotated this cycle.- Returns:
true
if so,false
if not.
-
teleportToSpawn
protected boolean teleportToSpawn()Teleport this entity to the spawn point of the main world. This is used to teleport out of the End.- Returns:
true
if the teleport was successful.
-
teleportToEnd
protected boolean teleportToEnd()Teleport this entity to the End. If no End world is loaded this does nothing.- Returns:
true
if the teleport was successful.
-
setSize
protected void setSize(float xz, float y) -
isTouchingMaterial
public boolean isTouchingMaterial(org.bukkit.Material material) Determine if this entity is intersecting a block of the specified type.If the entity has a defined bounding box, that is used to check for intersection. Otherwise, a less accurate calculation using only the entity's location and its surrounding blocks are used.
- Parameters:
material
- The material to check for.- Returns:
- True if the entity is intersecting
-
setBoundingBox
protected final void setBoundingBox(double xz, double y) -
getWidth
public double getWidth()- Specified by:
getWidth
in interfaceorg.bukkit.entity.Entity
-
getBoundingBox
public @NotNull org.bukkit.util.BoundingBox getBoundingBox()- Specified by:
getBoundingBox
in interfaceorg.bukkit.entity.Entity
-
setRotation
public void setRotation(float yaw, float pitch) - Specified by:
setRotation
in interfaceorg.bukkit.entity.Entity
-
getHeight
public double getHeight()- Specified by:
getHeight
in interfaceorg.bukkit.entity.Entity
-
intersects
-
pulsePhysics
protected void pulsePhysics() -
collide
public void collide(org.bukkit.block.Block block) Collide with the target block.- Parameters:
block
- a block whose typeMaterial.isOccluding()
-
updateBoundingBox
protected void updateBoundingBox() -
getMaxFireTicks
public int getMaxFireTicks()- Specified by:
getMaxFireTicks
in interfaceorg.bukkit.entity.Entity
-
setVisualFire
public void setVisualFire(boolean fire) - Specified by:
setVisualFire
in interfaceorg.bukkit.entity.Entity
-
isVisualFire
public boolean isVisualFire()- Specified by:
isVisualFire
in interfaceorg.bukkit.entity.Entity
-
getFreezeTicks
public int getFreezeTicks()- Specified by:
getFreezeTicks
in interfaceorg.bukkit.entity.Entity
-
getMaxFreezeTicks
public int getMaxFreezeTicks()- Specified by:
getMaxFreezeTicks
in interfaceorg.bukkit.entity.Entity
-
setFreezeTicks
public void setFreezeTicks(int ticks) - Specified by:
setFreezeTicks
in interfaceorg.bukkit.entity.Entity
-
isFrozen
public boolean isFrozen()- Specified by:
isFrozen
in interfaceorg.bukkit.entity.Entity
-
isFreezeTickingLocked
public boolean isFreezeTickingLocked()- Specified by:
isFreezeTickingLocked
in interfaceorg.bukkit.entity.Entity
-
lockFreezeTicks
public void lockFreezeTicks(boolean locked) - Specified by:
lockFreezeTicks
in interfaceorg.bukkit.entity.Entity
-
setFallDistance
public void setFallDistance(float distance) - Specified by:
setFallDistance
in interfaceorg.bukkit.entity.Entity
-
setOnGround
public void setOnGround(boolean onGround) Sets the on-ground flag and clears fall distance.- Parameters:
onGround
- true if this entity is now on the ground; false otherwise
-
remove
public void remove()Destroys this entity by removing it from the world and marking it as not being active.- Specified by:
remove
in interfaceorg.bukkit.entity.Entity
-
getNearbyEntities
- Specified by:
getNearbyEntities
in interfaceorg.bukkit.entity.Entity
-
playEffect
public void playEffect(org.bukkit.EntityEffect type) - Specified by:
playEffect
in interfaceorg.bukkit.entity.Entity
-
playEffectKnownAndSelf
public void playEffectKnownAndSelf(org.bukkit.EntityEffect type) -
getType
public org.bukkit.entity.EntityType getType()- Specified by:
getType
in interfaceorg.bukkit.entity.Entity
-
isInsideVehicle
public boolean isInsideVehicle()- Specified by:
isInsideVehicle
in interfaceorg.bukkit.entity.Entity
-
leaveVehicle
public boolean leaveVehicle()- Specified by:
leaveVehicle
in interfaceorg.bukkit.entity.Entity
-
customName
@Nullable public @Nullable net.kyori.adventure.text.Component customName()- Specified by:
customName
in interfaceorg.bukkit.Nameable
-
customName
public void customName(@Nullable @Nullable net.kyori.adventure.text.Component component) - Specified by:
customName
in interfaceorg.bukkit.Nameable
-
getCustomName
- Specified by:
getCustomName
in interfaceorg.bukkit.Nameable
-
setCustomName
- Specified by:
setCustomName
in interfaceorg.bukkit.Nameable
-
isCustomNameVisible
public boolean isCustomNameVisible()- Specified by:
isCustomNameVisible
in interfaceorg.bukkit.entity.Entity
-
setCustomNameVisible
public void setCustomNameVisible(boolean flag) - Specified by:
setCustomNameVisible
in interfaceorg.bukkit.entity.Entity
-
isGlowing
public boolean isGlowing()- Specified by:
isGlowing
in interfaceorg.bukkit.entity.Entity
-
setGlowing
public void setGlowing(boolean glowing) - Specified by:
setGlowing
in interfaceorg.bukkit.entity.Entity
-
getPassenger
public org.bukkit.entity.Entity getPassenger()- Specified by:
getPassenger
in interfaceorg.bukkit.entity.Entity
-
getPassengers
- Specified by:
getPassengers
in interfaceorg.bukkit.entity.Entity
-
removePassenger
public boolean removePassenger(org.bukkit.entity.Entity passenger) - Specified by:
removePassenger
in interfaceorg.bukkit.entity.Entity
-
addPassenger
public boolean addPassenger(org.bukkit.entity.Entity passenger) - Specified by:
addPassenger
in interfaceorg.bukkit.entity.Entity
-
setPassenger
public boolean setPassenger(org.bukkit.entity.Entity newPassenger) - Specified by:
setPassenger
in interfaceorg.bukkit.entity.Entity
-
getMountLocation
public org.bukkit.Location getMountLocation() -
getDismountLocation
public org.bukkit.Location getDismountLocation() -
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceorg.bukkit.entity.Entity
-
eject
public boolean eject()- Specified by:
eject
in interfaceorg.bukkit.entity.Entity
-
hasFriction
public boolean hasFriction() -
hasGravity
public boolean hasGravity()- Specified by:
hasGravity
in interfaceorg.bukkit.entity.Entity
-
getScoreboardTags
- Specified by:
getScoreboardTags
in interfaceorg.bukkit.entity.Entity
-
addScoreboardTag
- Specified by:
addScoreboardTag
in interfaceorg.bukkit.entity.Entity
-
removeScoreboardTag
- Specified by:
removeScoreboardTag
in interfaceorg.bukkit.entity.Entity
-
fromMobSpawner
public boolean fromMobSpawner()- Specified by:
fromMobSpawner
in interfaceorg.bukkit.entity.Entity
-
getPistonMoveReaction
public org.bukkit.block.PistonMoveReaction getPistonMoveReaction()- Specified by:
getPistonMoveReaction
in interfaceorg.bukkit.entity.Entity
-
isSilent
public boolean isSilent()- Specified by:
isSilent
in interfaceorg.bukkit.entity.Entity
-
setSilent
public void setSilent(boolean silent) - Specified by:
setSilent
in interfaceorg.bukkit.entity.Entity
-
setMetadata
- Specified by:
setMetadata
in interfaceorg.bukkit.metadata.Metadatable
-
damage
public void damage(double amount) -
damage
public void damage(double amount, org.bukkit.entity.Entity source) -
damage
public void damage(double amount, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) -
damage
public void damage(double amount, org.bukkit.entity.Entity source, @NotNull @NotNull org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) -
getMetadata
-
getMetadata
- Specified by:
getMetadata
in interfaceorg.bukkit.metadata.Metadatable
-
hasMetadata
- Specified by:
hasMetadata
in interfaceorg.bukkit.metadata.Metadatable
-
removeMetadata
- Specified by:
removeMetadata
in interfaceorg.bukkit.metadata.Metadatable
-
isPermissionSet
- Specified by:
isPermissionSet
in interfaceorg.bukkit.permissions.Permissible
-
isPermissionSet
public boolean isPermissionSet(org.bukkit.permissions.Permission permission) - Specified by:
isPermissionSet
in interfaceorg.bukkit.permissions.Permissible
-
hasPermission
- Specified by:
hasPermission
in interfaceorg.bukkit.permissions.Permissible
-
hasPermission
public boolean hasPermission(org.bukkit.permissions.Permission permission) - Specified by:
hasPermission
in interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String s, boolean b) - Specified by:
addAttachment
in interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin) - Specified by:
addAttachment
in interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String s, boolean b, int i) - Specified by:
addAttachment
in interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, int i) - Specified by:
addAttachment
in interfaceorg.bukkit.permissions.Permissible
-
removeAttachment
public void removeAttachment(org.bukkit.permissions.PermissionAttachment permissionAttachment) - Specified by:
removeAttachment
in interfaceorg.bukkit.permissions.Permissible
-
recalculatePermissions
public void recalculatePermissions()- Specified by:
recalculatePermissions
in interfaceorg.bukkit.permissions.Permissible
-
getEffectivePermissions
- Specified by:
getEffectivePermissions
in interfaceorg.bukkit.permissions.Permissible
-
entityInteract
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistent
in interfaceorg.bukkit.entity.Entity
-
setPersistent
public void setPersistent(boolean persistent) - Specified by:
setPersistent
in interfaceorg.bukkit.entity.Entity
-
hashCode
public int hashCode() -
equals
-
isLeashed
public boolean isLeashed() -
getLeashHolder
Gets the entity that is currently leading this entity.- Returns:
- the entity holding the leash
- Throws:
IllegalStateException
- if not currently leashed- See Also:
-
LivingEntity.getLeashHolder()
-
setLeashHolder
public boolean setLeashHolder(org.bukkit.entity.Entity holder) Sets the leash on this entity to be held by the supplied entity.This method has no effect on EnderDragons, Withers, Players, or Bats. Non-living entities excluding leashes will not persist as leash holders.
- Parameters:
holder
- the entity to leash this entity to- Returns:
- whether the operation was successful
- See Also:
-
LivingEntity.setLeashHolder(Entity)
-
setLeashHolderUniqueId
Set the unique ID of this entities leash holder. Only useful during load of the entity.- Parameters:
uniqueId
- The UUID
-
isInMaterial
public boolean isInMaterial(org.bukkit.Material type) -
isInWater
public boolean isInWater()- Specified by:
isInWater
in interfaceorg.bukkit.entity.Entity
-
isInRain
public boolean isInRain()- Specified by:
isInRain
in interfaceorg.bukkit.entity.Entity
-
isInBubbleColumn
public boolean isInBubbleColumn()- Specified by:
isInBubbleColumn
in interfaceorg.bukkit.entity.Entity
-
isInWaterOrRain
public boolean isInWaterOrRain()- Specified by:
isInWaterOrRain
in interfaceorg.bukkit.entity.Entity
-
isInWaterOrBubbleColumn
public boolean isInWaterOrBubbleColumn()- Specified by:
isInWaterOrBubbleColumn
in interfaceorg.bukkit.entity.Entity
-
isInWaterOrRainOrBubbleColumn
public boolean isInWaterOrRainOrBubbleColumn()- Specified by:
isInWaterOrRainOrBubbleColumn
in interfaceorg.bukkit.entity.Entity
-
isInLava
public boolean isInLava()- Specified by:
isInLava
in interfaceorg.bukkit.entity.Entity
-
getPersistentDataContainer
@NotNull public @NotNull org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()- Specified by:
getPersistentDataContainer
in interfaceorg.bukkit.persistence.PersistentDataHolder
-
getServer
The server this entity belongs to.- Specified by:
getServer
in interfaceorg.bukkit.command.CommandSender
- Specified by:
getServer
in interfaceorg.bukkit.entity.Entity
-
getOrigin
public org.bukkit.Location getOrigin()The original location of this entity.- Specified by:
getOrigin
in interfaceorg.bukkit.entity.Entity
-
getLeashedEntities
All entities that currently have this entity as leash holder. -
getCustomTags
List of custom String data for the entity. -
getWorld
The world this entity belongs to. Guarded byworldLock
.- Specified by:
getWorld
in interfaceorg.bukkit.entity.Entity
-
getEntityId
public int getEntityId()This entity's current identifier for its world.- Specified by:
getEntityId
in interfaceorg.bukkit.entity.Entity
-
isTeleported
public boolean isTeleported()Whether the entity should have its position resent as if teleported. -
getTicksLived
public int getTicksLived()A counter of how long this entity has existed.- Specified by:
getTicksLived
in interfaceorg.bukkit.entity.Entity
-
setTicksLived
public void setTicksLived(int ticksLived) A counter of how long this entity has existed.- Specified by:
setTicksLived
in interfaceorg.bukkit.entity.Entity
-
getVehicle
The entity this entity is currently riding.- Specified by:
getVehicle
in interfaceorg.bukkit.entity.Entity
-
isRemoved
public boolean isRemoved()Whether this entity was forcibly removed from the world. -
setAirDrag
public void setAirDrag(double airDrag) Velocity reduction applied each tick in air. For example, if the multiplier is 0.98, the entity will lose 2% of its velocity each physics tick. The default value 1 indicates no air drag. -
setLiquidDrag
public void setLiquidDrag(double liquidDrag) Velocity reduction applied each tick in water. For example, if the multiplier is 0.98, the entity will lose 2% of its velocity each physics tick. The default value 0.8 indicates 20% water drag. -
setGravityAccel
public void setGravityAccel(org.bukkit.util.Vector gravityAccel) Gravity acceleration applied each tick. The default value (0,0,0) indicates no gravity acceleration. -
setApplyDragBeforeAccel
public void setApplyDragBeforeAccel(boolean applyDragBeforeAccel) If drag is applied before appling acceleration while calculating physics. -
getLastDamageCause
public org.bukkit.event.entity.EntityDamageEvent getLastDamageCause()An EntityDamageEvent representing the last damage cause on this entity.- Specified by:
getLastDamageCause
in interfaceorg.bukkit.entity.Entity
-
setLastDamageCause
public void setLastDamageCause(org.bukkit.event.entity.EntityDamageEvent lastDamageCause) An EntityDamageEvent representing the last damage cause on this entity.- Specified by:
setLastDamageCause
in interfaceorg.bukkit.entity.Entity
-
isOnGround
public boolean isOnGround()A flag indicting if the entity is on the ground.- Specified by:
isOnGround
in interfaceorg.bukkit.entity.Entity
-
getFallDistance
public float getFallDistance()The distance the entity is currently falling without touching the ground.- Specified by:
getFallDistance
in interfaceorg.bukkit.entity.Entity
-
getFireTicks
public int getFireTicks()How long the entity has been on fire, or 0 if it is not.- Specified by:
getFireTicks
in interfaceorg.bukkit.entity.Entity
-
setFireTicks
public void setFireTicks(int fireTicks) How long the entity has been on fire, or 0 if it is not.- Specified by:
setFireTicks
in interfaceorg.bukkit.entity.Entity
-
setGravity
public void setGravity(boolean gravity) Whether gravity applies to the entity.- Specified by:
setGravity
in interfaceorg.bukkit.entity.Entity
-
setFriction
public void setFriction(boolean friction) Whether friction applies to the entity. -
isInvulnerable
public boolean isInvulnerable()Whether this entity is invulnerable.- Specified by:
isInvulnerable
in interfaceorg.bukkit.entity.Entity
-
setInvulnerable
public void setInvulnerable(boolean invulnerable) Whether this entity is invulnerable.- Specified by:
setInvulnerable
in interfaceorg.bukkit.entity.Entity
-
getPortalCooldown
public int getPortalCooldown()The Nether portal cooldown for the entity.- Specified by:
getPortalCooldown
in interfaceorg.bukkit.entity.Entity
-
setPortalCooldown
public void setPortalCooldown(int portalCooldown) The Nether portal cooldown for the entity.- Specified by:
setPortalCooldown
in interfaceorg.bukkit.entity.Entity
-
isOp
public boolean isOp()Whether this entity has operator permissions.- Specified by:
isOp
in interfaceorg.bukkit.permissions.ServerOperator
-
setOp
public void setOp(boolean op) Whether this entity has operator permissions.- Specified by:
setOp
in interfaceorg.bukkit.permissions.ServerOperator
-