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 booleanA flag indicating if this entity is currently active.protected doubleVelocity reduction applied each tick in air.protected booleanIf drag is applied before appling acceleration while calculating physics.protected EntityBoundingBoxThe entity's bounding box, or null if it has no physical presence.static final intAn 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 intThis entity's current identifier for its world.protected org.bukkit.util.VectorGravity acceleration applied each tick.protected doubleVelocity reduction applied each tick in water.protected final org.bukkit.LocationThe current position.protected final MetadataMapThe entity's metadata.protected booleanprotected final org.bukkit.LocationThe position in the last cycle.protected booleanWhether this entity was forcibly removed from the world.protected final GlowServerThe server this entity belongs to.protected doubleThe slipperiness multiplier applied according to the block this entity was on.protected booleanWhether the entity should have its position resent as if teleported.protected intA counter of how long this entity has existed.protected GlowEntityThe entity this entity is currently riding.protected final org.bukkit.util.VectorThe entity's velocity, applied each tick.protected booleanWhether the entity should have its velocity resent.protected GlowWorldThe world this entity belongs to.protected final ReadWriteLockLock 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.PermissionAttachmentaddAttachment(org.bukkit.plugin.Plugin plugin) org.bukkit.permissions.PermissionAttachmentaddAttachment(org.bukkit.plugin.Plugin plugin, int i) org.bukkit.permissions.PermissionAttachmentaddAttachment(org.bukkit.plugin.Plugin plugin, String s, boolean b) org.bukkit.permissions.PermissionAttachmentaddAttachment(org.bukkit.plugin.Plugin plugin, String s, boolean b, int i) booleanaddPassenger(org.bukkit.entity.Entity passenger) booleanaddScoreboardTag(String tag) voidcollide(org.bukkit.block.Block block) Collide with the target block.List<com.flowpowered.network.Message>createAfterSpawnMessage(GlowSession session) Creates a List ofMessagewhich can be sent to a client directly after the entity is spawned.abstract List<com.flowpowered.network.Message>Creates a list ofMessages which can be sent to a client to spawn this entity.List<com.flowpowered.network.Message>createUpdateMessage(GlowSession session) Creates aMessagewhich can be sent to a client to update this entity.@Nullable net.kyori.adventure.text.ComponentvoidcustomName(@Nullable net.kyori.adventure.text.Component component) voiddamage(double amount) voiddamage(double amount, org.bukkit.entity.Entity source) voiddamage(double amount, org.bukkit.entity.Entity source, @NotNull org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) voiddamage(double amount, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) booleaneject()booleanentityInteract(GlowPlayer player, InteractEntityMessage message) booleanboolean@NotNull org.bukkit.util.BoundingBoxorg.bukkit.block.BlockFaceGet the direction (SOUTH, WEST, NORTH, or EAST) this entity is facing.org.bukkit.ChunkgetChunk()List of custom String data for the entity.org.bukkit.LocationSet<org.bukkit.permissions.PermissionAttachmentInfo>intThis entity's current identifier for its world.@NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReasonorg.bukkit.block.BlockFaceGets the full direction (including SOUTH_SOUTH_EAST etc) this entity is facing.floatThe distance the entity is currently falling without touching the ground.intHow long the entity has been on fire, or 0 if it is not.intorg.bukkit.util.VectorReturns the change in velocity per physics tick due to gravity.doubleorg.bukkit.event.entity.EntityDamageEventAn EntityDamageEvent representing the last damage cause on this entity.All entities that currently have this entity as leash holder.@NotNull org.bukkit.entity.EntityGets the entity that is currently leading this entity.@NotNull org.bukkit.Locationorg.bukkit.LocationgetLocation(org.bukkit.Location loc) intintList<org.bukkit.metadata.MetadataValue>getMetadata(String metadataKey) org.bukkit.LocationgetName()List<org.bukkit.entity.Entity>getNearbyEntities(double x, double y, double z) org.bukkit.LocationThe original location of this entity.org.bukkit.entity.EntityList<org.bukkit.entity.Entity>@NotNull org.bukkit.persistence.PersistentDataContainerorg.bukkit.block.PistonMoveReactionintThe Nether portal cooldown for the entity.@NotNull org.bukkit.entity.PosegetPose()The server this entity belongs to.@NotNull org.bukkit.entity.SpawnCategoryintA counter of how long this entity has existed.@NotNull Set<org.bukkit.entity.Player>org.bukkit.entity.EntityTypegetType()The entity this entity is currently riding.org.bukkit.util.VectordoublegetWidth()getWorld()The world this entity belongs to.protected booleanIf true,setRawLocation(Location, boolean)withfalltrue will callsetOnGround(boolean)according to whether or not our location is inside a solid block.booleanbooleaninthashCode()booleanhasMetadata(String metadataKey) booleanhasMoved()Checks if this entity has moved this cycle.booleanbooleanhasPermission(org.bukkit.permissions.Permission permission) booleanChecks if this entity has rotated this cycle.booleanintersects(BoundingBox box) booleanbooleanisDead()booleanisEmpty()booleanbooleanisFrozen()booleanbooleanbooleanisInLava()booleanisInMaterial(org.bukkit.Material type) booleanbooleanisInRain()booleanbooleanWhether this entity is invulnerable.booleanbooleanbooleanbooleanbooleanbooleanA flag indicting if the entity is on the ground.booleanisOp()Whether this entity has operator permissions.booleanbooleanisPermissionSet(org.bukkit.permissions.Permission permission) booleanbooleanWhether this entity was forcibly removed from the world.booleanisSilent()booleanWhether the entity should have its position resent as if teleported.booleanbooleanisTouchingMaterial(org.bukkit.Material material) Determine if this entity is intersecting a block of the specified type.booleanisValid()booleanbooleanisWithinDistance(GlowEntity other) Checks if this entity is within the visible radius of another.booleanisWithinDistance(org.bukkit.Location loc) Checks if this entity is within the visible radius of a location.booleanvoidlockFreezeTicks(boolean locked) @NotNull net.kyori.adventure.text.Componentname()voidplayEffect(org.bukkit.EntityEffect type) voidplayEffectKnownAndSelf(org.bukkit.EntityEffect type) voidpulse()Called every game cycle.protected voidvoidvoidremove()Destroys this entity by removing it from the world and marking it as not being active.voidremoveAttachment(org.bukkit.permissions.PermissionAttachment permissionAttachment) voidremoveMetadata(String metadataKey, org.bukkit.plugin.Plugin owningPlugin) booleanremovePassenger(org.bukkit.entity.Entity passenger) booleanvoidreset()Resets the previous location and other properties to their current value.voidsendMessage(@Nullable UUID sender, @NotNull String message) voidsendMessage(@Nullable UUID sender, @NotNull String[] messages) voidsendMessage(String message) voidsendMessage(String[] strings) voidsetAirDrag(double airDrag) Velocity reduction applied each tick in air.voidsetApplyDragBeforeAccel(boolean applyDragBeforeAccel) If drag is applied before appling acceleration while calculating physics.protected final voidsetBoundingBox(double xz, double y) voidsetCustomName(String name) voidsetCustomNameVisible(boolean flag) voidsetFallDistance(float distance) voidsetFireTicks(int fireTicks) How long the entity has been on fire, or 0 if it is not.voidsetFreezeTicks(int ticks) voidsetFriction(boolean friction) Whether friction applies to the entity.voidsetGlowing(boolean glowing) voidsetGravity(boolean gravity) Whether gravity applies to the entity.voidsetGravityAccel(org.bukkit.util.Vector gravityAccel) Gravity acceleration applied each tick.voidsetInvulnerable(boolean invulnerable) Whether this entity is invulnerable.voidsetLastDamageCause(org.bukkit.event.entity.EntityDamageEvent lastDamageCause) An EntityDamageEvent representing the last damage cause on this entity.booleansetLeashHolder(org.bukkit.entity.Entity holder) Sets the leash on this entity to be held by the supplied entity.voidsetLeashHolderUniqueId(UUID uniqueId) Set the unique ID of this entities leash holder.voidsetLiquidDrag(double liquidDrag) Velocity reduction applied each tick in water.voidsetMetadata(String metadataKey, org.bukkit.metadata.MetadataValue newMetadataValue) voidsetOnGround(boolean onGround) Sets the on-ground flag and clears fall distance.voidsetOp(boolean op) Whether this entity has operator permissions.booleansetPassenger(org.bukkit.entity.Entity newPassenger) voidsetPersistent(boolean persistent) voidsetPortalCooldown(int portalCooldown) The Nether portal cooldown for the entity.voidsetRawLocation(org.bukkit.Location location) Sets this entity's location and applies fall damage calculations.voidsetRawLocation(org.bukkit.Location location, boolean fall) Sets this entity's location.voidsetRotation(float yaw, float pitch) voidsetSilent(boolean silent) protected voidsetSize(float xz, float y) voidsetTicksLived(int ticksLived) A counter of how long this entity has existed.voidsetUniqueId(UUID uuid) Sets this entity's unique identifier if possible.voidsetVelocity(org.bukkit.util.Vector velocity) voidsetVisualFire(boolean fire) booleanChecks whether this entity should be saved as part of the world.booleanspawnAt(@NotNull org.bukkit.Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) @NotNull org.bukkit.entity.Entity.Spigotspigot()@NotNull net.kyori.adventure.text.Componentbooleanteleport(org.bukkit.entity.Entity destination) booleanteleport(org.bukkit.entity.Entity destination, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) booleanteleport(org.bukkit.Location location) booleanteleport(org.bukkit.Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) protected booleanTeleport this entity to the End.protected booleanTeleport this entity to the spawn point of the main world.toString()protected voidMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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, stopSoundMethods inherited from interface org.bukkit.command.CommandSender
sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessageMethods inherited from interface org.bukkit.entity.Entity
asHoverEvent, spawnAt, teleportAsync, teleportAsyncMethods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEventMethods inherited from interface org.bukkit.permissions.Permissible
permissionValue, permissionValueMethods 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:
sendMessagein interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessagein interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessagein interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessagein interfaceorg.bukkit.command.CommandSender
-
getName
- Specified by:
getNamein interfaceorg.bukkit.command.CommandSender
-
getUniqueId
- Specified by:
getUniqueIdin 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:
isDeadin interfaceorg.bukkit.entity.Entity
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceorg.bukkit.entity.Entity
-
getLocation
@NotNull public @NotNull org.bukkit.Location getLocation()- Specified by:
getLocationin interfaceorg.bukkit.entity.Entity
-
getLocation
public org.bukkit.Location getLocation(org.bukkit.Location loc) - Specified by:
getLocationin interfaceorg.bukkit.entity.Entity
-
getChunk
public org.bukkit.Chunk getChunk()- Specified by:
getChunkin interfaceorg.bukkit.entity.Entity
-
getEntitySpawnReason
public @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason()- Specified by:
getEntitySpawnReasonin 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:
getFacingin interfaceorg.bukkit.entity.Entity- Returns:
- The intercardinal BlockFace of this entity
-
getPose
@NotNull public @NotNull org.bukkit.entity.Pose getPose()- Specified by:
getPosein interfaceorg.bukkit.entity.Entity
-
getSpawnCategory
@NotNull public @NotNull org.bukkit.entity.SpawnCategory getSpawnCategory()- Specified by:
getSpawnCategoryin interfaceorg.bukkit.entity.Entity
-
spigot
@NotNull public @NotNull org.bukkit.entity.Entity.Spigot spigot()- Specified by:
spigotin interfaceorg.bukkit.command.CommandSender- Specified by:
spigotin interfaceorg.bukkit.entity.Entity
-
name
@NotNull public @NotNull net.kyori.adventure.text.Component name()- Specified by:
namein interfaceorg.bukkit.command.CommandSender
-
teamDisplayName
@NotNull public @NotNull net.kyori.adventure.text.Component teamDisplayName()- Specified by:
teamDisplayNamein interfaceorg.bukkit.entity.Entity
-
getVelocity
public org.bukkit.util.Vector getVelocity()- Specified by:
getVelocityin interfaceorg.bukkit.entity.Entity
-
setVelocity
public void setVelocity(org.bukkit.util.Vector velocity) - Specified by:
setVelocityin 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:
teleportin interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.entity.Entity destination) - Specified by:
teleportin interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) - Specified by:
teleportin interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.entity.Entity destination, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) - Specified by:
teleportin interfaceorg.bukkit.entity.Entity
-
isWithinDistance
Checks if this entity is within the visible radius of another.- Parameters:
other- The other entity.- Returns:
trueif the entities can see each other,falseif 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:
trueif the entities can see each other,falseif 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:
isTickingin interfaceorg.bukkit.entity.Entity
-
getTrackedPlayers
- Specified by:
getTrackedPlayersin interfaceorg.bukkit.entity.Entity
-
spawnAt
public boolean spawnAt(@NotNull @NotNull org.bukkit.Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) - Specified by:
spawnAtin interfaceorg.bukkit.entity.Entity
-
isInPowderedSnow
public boolean isInPowderedSnow()- Specified by:
isInPowderedSnowin 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)withfalltrue 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 ofMessages 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 ofMessagewhich 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 aMessagewhich 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:
trueif so,falseif not.
-
hasRotated
public boolean hasRotated()Checks if this entity has rotated this cycle.- Returns:
trueif so,falseif 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:
trueif the teleport was successful.
-
teleportToEnd
protected boolean teleportToEnd()Teleport this entity to the End. If no End world is loaded this does nothing.- Returns:
trueif 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:
getWidthin interfaceorg.bukkit.entity.Entity
-
getBoundingBox
public @NotNull org.bukkit.util.BoundingBox getBoundingBox()- Specified by:
getBoundingBoxin interfaceorg.bukkit.entity.Entity
-
setRotation
public void setRotation(float yaw, float pitch) - Specified by:
setRotationin interfaceorg.bukkit.entity.Entity
-
getHeight
public double getHeight()- Specified by:
getHeightin 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:
getMaxFireTicksin interfaceorg.bukkit.entity.Entity
-
setVisualFire
public void setVisualFire(boolean fire) - Specified by:
setVisualFirein interfaceorg.bukkit.entity.Entity
-
isVisualFire
public boolean isVisualFire()- Specified by:
isVisualFirein interfaceorg.bukkit.entity.Entity
-
getFreezeTicks
public int getFreezeTicks()- Specified by:
getFreezeTicksin interfaceorg.bukkit.entity.Entity
-
getMaxFreezeTicks
public int getMaxFreezeTicks()- Specified by:
getMaxFreezeTicksin interfaceorg.bukkit.entity.Entity
-
setFreezeTicks
public void setFreezeTicks(int ticks) - Specified by:
setFreezeTicksin interfaceorg.bukkit.entity.Entity
-
isFrozen
public boolean isFrozen()- Specified by:
isFrozenin interfaceorg.bukkit.entity.Entity
-
isFreezeTickingLocked
public boolean isFreezeTickingLocked()- Specified by:
isFreezeTickingLockedin interfaceorg.bukkit.entity.Entity
-
lockFreezeTicks
public void lockFreezeTicks(boolean locked) - Specified by:
lockFreezeTicksin interfaceorg.bukkit.entity.Entity
-
setFallDistance
public void setFallDistance(float distance) - Specified by:
setFallDistancein 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:
removein interfaceorg.bukkit.entity.Entity
-
getNearbyEntities
- Specified by:
getNearbyEntitiesin interfaceorg.bukkit.entity.Entity
-
playEffect
public void playEffect(org.bukkit.EntityEffect type) - Specified by:
playEffectin interfaceorg.bukkit.entity.Entity
-
playEffectKnownAndSelf
public void playEffectKnownAndSelf(org.bukkit.EntityEffect type) -
getType
public org.bukkit.entity.EntityType getType()- Specified by:
getTypein interfaceorg.bukkit.entity.Entity
-
isInsideVehicle
public boolean isInsideVehicle()- Specified by:
isInsideVehiclein interfaceorg.bukkit.entity.Entity
-
leaveVehicle
public boolean leaveVehicle()- Specified by:
leaveVehiclein interfaceorg.bukkit.entity.Entity
-
customName
@Nullable public @Nullable net.kyori.adventure.text.Component customName()- Specified by:
customNamein interfaceorg.bukkit.Nameable
-
customName
public void customName(@Nullable @Nullable net.kyori.adventure.text.Component component) - Specified by:
customNamein interfaceorg.bukkit.Nameable
-
getCustomName
- Specified by:
getCustomNamein interfaceorg.bukkit.Nameable
-
setCustomName
- Specified by:
setCustomNamein interfaceorg.bukkit.Nameable
-
isCustomNameVisible
public boolean isCustomNameVisible()- Specified by:
isCustomNameVisiblein interfaceorg.bukkit.entity.Entity
-
setCustomNameVisible
public void setCustomNameVisible(boolean flag) - Specified by:
setCustomNameVisiblein interfaceorg.bukkit.entity.Entity
-
isGlowing
public boolean isGlowing()- Specified by:
isGlowingin interfaceorg.bukkit.entity.Entity
-
setGlowing
public void setGlowing(boolean glowing) - Specified by:
setGlowingin interfaceorg.bukkit.entity.Entity
-
getPassenger
public org.bukkit.entity.Entity getPassenger()- Specified by:
getPassengerin interfaceorg.bukkit.entity.Entity
-
getPassengers
- Specified by:
getPassengersin interfaceorg.bukkit.entity.Entity
-
removePassenger
public boolean removePassenger(org.bukkit.entity.Entity passenger) - Specified by:
removePassengerin interfaceorg.bukkit.entity.Entity
-
addPassenger
public boolean addPassenger(org.bukkit.entity.Entity passenger) - Specified by:
addPassengerin interfaceorg.bukkit.entity.Entity
-
setPassenger
public boolean setPassenger(org.bukkit.entity.Entity newPassenger) - Specified by:
setPassengerin interfaceorg.bukkit.entity.Entity
-
getMountLocation
public org.bukkit.Location getMountLocation() -
getDismountLocation
public org.bukkit.Location getDismountLocation() -
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceorg.bukkit.entity.Entity
-
eject
public boolean eject()- Specified by:
ejectin interfaceorg.bukkit.entity.Entity
-
hasFriction
public boolean hasFriction() -
hasGravity
public boolean hasGravity()- Specified by:
hasGravityin interfaceorg.bukkit.entity.Entity
-
getScoreboardTags
- Specified by:
getScoreboardTagsin interfaceorg.bukkit.entity.Entity
-
addScoreboardTag
- Specified by:
addScoreboardTagin interfaceorg.bukkit.entity.Entity
-
removeScoreboardTag
- Specified by:
removeScoreboardTagin interfaceorg.bukkit.entity.Entity
-
fromMobSpawner
public boolean fromMobSpawner()- Specified by:
fromMobSpawnerin interfaceorg.bukkit.entity.Entity
-
getPistonMoveReaction
public org.bukkit.block.PistonMoveReaction getPistonMoveReaction()- Specified by:
getPistonMoveReactionin interfaceorg.bukkit.entity.Entity
-
isSilent
public boolean isSilent()- Specified by:
isSilentin interfaceorg.bukkit.entity.Entity
-
setSilent
public void setSilent(boolean silent) - Specified by:
setSilentin interfaceorg.bukkit.entity.Entity
-
setMetadata
- Specified by:
setMetadatain 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:
getMetadatain interfaceorg.bukkit.metadata.Metadatable
-
hasMetadata
- Specified by:
hasMetadatain interfaceorg.bukkit.metadata.Metadatable
-
removeMetadata
- Specified by:
removeMetadatain interfaceorg.bukkit.metadata.Metadatable
-
isPermissionSet
- Specified by:
isPermissionSetin interfaceorg.bukkit.permissions.Permissible
-
isPermissionSet
public boolean isPermissionSet(org.bukkit.permissions.Permission permission) - Specified by:
isPermissionSetin interfaceorg.bukkit.permissions.Permissible
-
hasPermission
- Specified by:
hasPermissionin interfaceorg.bukkit.permissions.Permissible
-
hasPermission
public boolean hasPermission(org.bukkit.permissions.Permission permission) - Specified by:
hasPermissionin interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String s, boolean b) - Specified by:
addAttachmentin interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin) - Specified by:
addAttachmentin interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String s, boolean b, int i) - Specified by:
addAttachmentin interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, int i) - Specified by:
addAttachmentin interfaceorg.bukkit.permissions.Permissible
-
removeAttachment
public void removeAttachment(org.bukkit.permissions.PermissionAttachment permissionAttachment) - Specified by:
removeAttachmentin interfaceorg.bukkit.permissions.Permissible
-
recalculatePermissions
public void recalculatePermissions()- Specified by:
recalculatePermissionsin interfaceorg.bukkit.permissions.Permissible
-
getEffectivePermissions
- Specified by:
getEffectivePermissionsin interfaceorg.bukkit.permissions.Permissible
-
entityInteract
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistentin interfaceorg.bukkit.entity.Entity
-
setPersistent
public void setPersistent(boolean persistent) - Specified by:
setPersistentin 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:
isInWaterin interfaceorg.bukkit.entity.Entity
-
isInRain
public boolean isInRain()- Specified by:
isInRainin interfaceorg.bukkit.entity.Entity
-
isInBubbleColumn
public boolean isInBubbleColumn()- Specified by:
isInBubbleColumnin interfaceorg.bukkit.entity.Entity
-
isInWaterOrRain
public boolean isInWaterOrRain()- Specified by:
isInWaterOrRainin interfaceorg.bukkit.entity.Entity
-
isInWaterOrBubbleColumn
public boolean isInWaterOrBubbleColumn()- Specified by:
isInWaterOrBubbleColumnin interfaceorg.bukkit.entity.Entity
-
isInWaterOrRainOrBubbleColumn
public boolean isInWaterOrRainOrBubbleColumn()- Specified by:
isInWaterOrRainOrBubbleColumnin interfaceorg.bukkit.entity.Entity
-
isInLava
public boolean isInLava()- Specified by:
isInLavain interfaceorg.bukkit.entity.Entity
-
getPersistentDataContainer
@NotNull public @NotNull org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()- Specified by:
getPersistentDataContainerin interfaceorg.bukkit.persistence.PersistentDataHolder
-
getServer
The server this entity belongs to.- Specified by:
getServerin interfaceorg.bukkit.command.CommandSender- Specified by:
getServerin interfaceorg.bukkit.entity.Entity
-
getOrigin
public org.bukkit.Location getOrigin()The original location of this entity.- Specified by:
getOriginin 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:
getWorldin interfaceorg.bukkit.entity.Entity
-
getEntityId
public int getEntityId()This entity's current identifier for its world.- Specified by:
getEntityIdin 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:
getTicksLivedin interfaceorg.bukkit.entity.Entity
-
setTicksLived
public void setTicksLived(int ticksLived) A counter of how long this entity has existed.- Specified by:
setTicksLivedin interfaceorg.bukkit.entity.Entity
-
getVehicle
The entity this entity is currently riding.- Specified by:
getVehiclein 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:
getLastDamageCausein 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:
setLastDamageCausein interfaceorg.bukkit.entity.Entity
-
isOnGround
public boolean isOnGround()A flag indicting if the entity is on the ground.- Specified by:
isOnGroundin interfaceorg.bukkit.entity.Entity
-
getFallDistance
public float getFallDistance()The distance the entity is currently falling without touching the ground.- Specified by:
getFallDistancein interfaceorg.bukkit.entity.Entity
-
getFireTicks
public int getFireTicks()How long the entity has been on fire, or 0 if it is not.- Specified by:
getFireTicksin 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:
setFireTicksin interfaceorg.bukkit.entity.Entity
-
setGravity
public void setGravity(boolean gravity) Whether gravity applies to the entity.- Specified by:
setGravityin 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:
isInvulnerablein interfaceorg.bukkit.entity.Entity
-
setInvulnerable
public void setInvulnerable(boolean invulnerable) Whether this entity is invulnerable.- Specified by:
setInvulnerablein interfaceorg.bukkit.entity.Entity
-
getPortalCooldown
public int getPortalCooldown()The Nether portal cooldown for the entity.- Specified by:
getPortalCooldownin interfaceorg.bukkit.entity.Entity
-
setPortalCooldown
public void setPortalCooldown(int portalCooldown) The Nether portal cooldown for the entity.- Specified by:
setPortalCooldownin interfaceorg.bukkit.entity.Entity
-
isOp
public boolean isOp()Whether this entity has operator permissions.- Specified by:
isOpin interfaceorg.bukkit.permissions.ServerOperator
-
setOp
public void setOp(boolean op) Whether this entity has operator permissions.- Specified by:
setOpin interfaceorg.bukkit.permissions.ServerOperator
-