Interface Entity
- All Superinterfaces:
- Audience,- CommandSender,- HoverEventSource<HoverEvent.ShowEntity>,- Metadatable,- Nameable,- Permissible,- PersistentDataHolder,- Pointered,- ServerOperator,- Sound.Emitter
- All Known Subinterfaces:
- AbstractArrow,- AbstractHorse,- AbstractSkeleton,- AbstractVillager,- Ageable,- Allay,- Ambient,- Animals,- AreaEffectCloud,- ArmorStand,- Arrow,- Axolotl,- Bat,- Bee,- Blaze,- BlockDisplay,- Boat,- Boss,- Breedable,- Bucketable,- Camel,- Cat,- CaveSpider,- ChestBoat,- ChestedHorse,- Chicken,- Cod,- CollarColorable,- CommandMinecart,- ComplexEntityPart,- ComplexLivingEntity,- Cow,- Creature,- Creeper,- Damageable,- Display,- Dolphin,- Donkey,- DragonFireball,- Drowned,- Egg,- ElderGuardian,- EnderCrystal,- EnderDragon,- EnderDragonPart,- Enderman,- Endermite,- EnderPearl,- EnderSignal,- Enemy,- Evoker,- EvokerFangs,- ExperienceOrb,- Explosive,- ExplosiveMinecart,- FallingBlock,- Fireball,- Firework,- Fish,- FishHook,- Flying,- Fox,- Frog,- Ghast,- Giant,- GlowItemFrame,- GlowSquid,- Goat,- Golem,- Guardian,- Hanging,- Hoglin,- HopperMinecart,- Horse,- HumanEntity,- Husk,- Illager,- Illusioner,- Interaction,- IronGolem,- Item,- ItemDisplay,- ItemFrame,- LargeFireball,- LeashHitch,- LightningStrike,- LingeringPotion,- LivingEntity,- Llama,- LlamaSpit,- MagmaCube,- Marker,- Minecart,- Mob,- Monster,- Mule,- MushroomCow,- NPC,- Ocelot,- Painting,- Panda,- Parrot,- Phantom,- Pig,- Piglin,- PiglinAbstract,- PiglinBrute,- PigZombie,- Pillager,- Player,- PolarBear,- PoweredMinecart,- Projectile,- PufferFish,- Rabbit,- Raider,- RangedEntity,- Ravager,- RideableMinecart,- Salmon,- SchoolableFish,- Shearable,- Sheep,- Shulker,- ShulkerBullet,- Silverfish,- SizedFireball,- Skeleton,- SkeletonHorse,- Slime,- SmallFireball,- Sniffer,- Snowball,- Snowman,- SpawnerMinecart,- SpectralArrow,- Spellcaster,- Spider,- SplashPotion,- Squid,- Steerable,- StorageMinecart,- Stray,- Strider,- Tadpole,- Tameable,- TextDisplay,- ThrowableProjectile,- ThrownExpBottle,- ThrownPotion,- TippedArrow,- TNTPrimed,- TraderLlama,- Trident,- TropicalFish,- Turtle,- Vehicle,- Vex,- Villager,- Vindicator,- WanderingTrader,- Warden,- WaterMob,- Witch,- Wither,- WitherSkeleton,- WitherSkull,- Wolf,- Zoglin,- Zombie,- ZombieHorse,- ZombieVillager
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddPassenger(@NotNull Entity passenger) Add a passenger to the vehicle.booleanAdd a tag to this entity.default HoverEvent<HoverEvent.ShowEntity>Creates a hover event with value derived from this object.booleancollidesAt(@NotNull Location location) Checks for any collisions with the entity's bounding box at the provided location.booleaneject()Eject any passenger.booleanReturns whether this entity was spawned from a mob spawner.Gets the entity's current bounding box.getChunk()Gets the latest chunk an entity is currently or was in.intReturns a unique id for this entityGet the closest cardinalBlockFacedirection an entity is currently facing.floatReturns the distance this entity has fallenintReturns the entity's current fire ticks (ticks before the entity stops being on fire).intReturns the entity's current freeze ticks (amount of ticks the entity has been in powdered snow).doubleGets the entity's heightRetrieve the lastEntityDamageEventinflicted on this entity.Gets the entity's current positiongetLocation(@Nullable Location loc) Stores the entity's current position in the provided Location object.intReturns the entity's maximum fire ticks.intReturns the entity's maximum freeze ticks (amount of ticks before it will be fully frozen)getNearbyEntities(double x, double y, double z) Returns a list of entities within a bounding box centered around this entityGets the location where this entity originates from.Deprecated.Gets a list of passengers of this vehicle.Returns the reaction of the entity when moved by a piston.intGets the period of time (in ticks) before this entity can use a portal.getPose()Gets the entity's current pose.Returns the task scheduler for this entity.Returns a set of tags for this entity.Gets theServerthat contains this EntityGet the category of spawn to which this entity belongs.Get theSoundthis entity makes when splashing in water at high speeds.Get theSoundthis entity makes while swimming.Get theSoundthis entity makes when splashing in water.intGets the amount of ticks this entity has lived for.Returns a set ofPlayerswithin this entity's tracking range (players that can "see" this entity).getType()Get the type of the entity.Returns a unique and persistent id for this entityGet the vehicle that this entity is inside.Gets this entity's current velocitydoublegetWidth()Gets the entity's widthgetWorld()Gets the current world this entity resides inbooleanReturns whether gravity applies to this entity.booleanGets whether or not the mob's custom name is displayed client side.booleanisDead()Returns true if this entity has been marked for removal.booleanisEmpty()Check if a vehicle has passengers.booleanGets if the entity currently has its freeze ticks locked to a set amount.booleanisFrozen()Gets if the entity is fully frozen (it has been in powdered snow for max freeze ticks).booleanGets whether the entity is glowing or not.booleanCheck if entity is in bubble columnbooleanisInLava()Check if entity is in lavabooleanCheck if entity is inside powdered snow.booleanisInRain()Check if entity is in rainbooleanReturns whether this entity is inside a vehicle.booleanGets whether the entity is invulnerable or not.booleanReturns true if the entity is in water.booleanCheck if entity is in water or bubble columnbooleanCheck if entity is in water or rainbooleanCheck if entity is in water or rain or bubble columnbooleanReturns true if the entity is supported by a block.booleanReturns true if the entity gets persisted.booleanisSilent()Gets whether the entity is silent or not.booleanReturns if the entity is in sneak modebooleanCheck if entity is inside a ticking chunkbooleanCheck if entity is underwaterbooleanisValid()Returns false if the entity has died or been despawned for some other reason.booleanDeprecated.draft APIbooleanGets if the entity has visual fire (it will always appear to be on fire).booleanLeave the current vehicle.voidlockFreezeTicks(boolean locked) Sets if the entity currently has its freeze ticks locked, preventing default vanilla freeze tick modification.voidplayEffect(@NotNull EntityEffect type) Performs the specifiedEntityEffectfor this entity.voidremove()Mark the entity's removal.booleanremovePassenger(@NotNull Entity passenger) Remove a passenger from the vehicle.booleanRemoves a given tag from this entity.voidsetCustomNameVisible(boolean flag) Sets whether or not to display the mob's custom name client side.voidsetFallDistance(float distance) Sets the fall distance for this entityvoidsetFireTicks(int ticks) Sets the entity's current fire ticks (ticks before the entity stops being on fire).voidsetFreezeTicks(int ticks) Sets the entity's current freeze ticks (amount of ticks the entity has been in powdered snow).voidsetGlowing(boolean flag) Sets whether the entity has a team colored (default: white) glow.voidsetGravity(boolean gravity) Sets whether gravity applies to this entity.voidsetInvulnerable(boolean flag) Sets whether the entity is invulnerable or not.voidRecord the lastEntityDamageEventinflicted on this entitybooleansetPassenger(@NotNull Entity passenger) Deprecated.entities may have multiple passengers, useaddPassenger(org.bukkit.entity.Entity)voidsetPersistent(boolean persistent) Sets whether or not the entity gets persisted.voidsetPortalCooldown(int cooldown) Sets the period of time (in ticks) before this entity can use a portal.voidsetRotation(float yaw, float pitch) Sets the entity's rotation.voidsetSilent(boolean flag) Sets whether the entity is silent or not.voidsetSneaking(boolean sneak) Sets the sneak mode the entity.voidsetTicksLived(int value) Sets the amount of ticks this entity has lived for.voidsetVelocity(@NotNull Vector velocity) Sets this entity's velocity in meters per tickvoidsetVisibleByDefault(boolean visible) Deprecated.draft APIvoidsetVisualFire(boolean fire) Sets if the entity has visual fire (it will always appear to be on fire).default booleanSpawns the entity in the world at the givenLocationwith the default spawn reason.booleanspawnAt(@NotNull Location location, CreatureSpawnEvent.SpawnReason reason) Spawns the entity in the world at the givenLocationwith the reason given.spigot()Gets the entity's display name formatted with their team prefix/suffix and the entity's default hover/click events.booleanTeleports this entity to the target Entity.booleanteleport(@NotNull Entity destination, @NotNull PlayerTeleportEvent.TeleportCause cause) Teleports this entity to the target Entity.booleanTeleports this entity to the given location.default booleanTeleports this entity to the given location.booleanteleport(@NotNull Location location, @NotNull PlayerTeleportEvent.TeleportCause cause) Teleports this entity to the given location.booleanteleport(@NotNull Location location, @NotNull PlayerTeleportEvent.TeleportCause cause, @NotNull TeleportFlag @NotNull ... teleportFlags) Teleports this entity to the given location.default CompletableFuture<Boolean>Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.default CompletableFuture<Boolean>Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.booleanwouldCollideUsing(@NotNull BoundingBox boundingBox) This checks using the given boundingbox as the entity's boundingbox if the entity would collide with anything.Methods inherited from interface net.kyori.adventure.audience.AudienceclearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, 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.CommandSendergetName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessageMethods inherited from interface net.kyori.adventure.text.event.HoverEventSourceasHoverEventMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.NameablecustomName, customName, getCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.PermissibleaddAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainerMethods inherited from interface net.kyori.adventure.pointer.Pointeredget, getOrDefault, getOrDefaultFrom, pointersMethods inherited from interface org.bukkit.permissions.ServerOperatorisOp, setOp
- 
Method Details- 
getLocationGets the entity's current position- Returns:
- a new copy of Location containing the position of this entity
 
- 
getLocation@Contract("null -> null; !null -> !null") @Nullable @Nullable Location getLocation(@Nullable @Nullable Location loc) Stores the entity's current position in the provided Location object.If the provided Location is null this method does nothing and returns null. - Parameters:
- loc- the location to copy into
- Returns:
- The Location object provided or null
 
- 
setVelocitySets this entity's velocity in meters per tick- Parameters:
- velocity- New velocity to travel with
 
- 
getVelocityGets this entity's current velocity- Returns:
- Current traveling velocity of this entity
 
- 
getHeightdouble getHeight()Gets the entity's height- Returns:
- height of entity
 
- 
getWidthdouble getWidth()Gets the entity's width- Returns:
- width of entity
 
- 
getBoundingBoxGets the entity's current bounding box.The returned bounding box reflects the entity's current location and size. - Returns:
- the entity's current bounding box
 
- 
isOnGroundboolean isOnGround()Returns true if the entity is supported by a block. This value is a state updated by the server and is not recalculated unless the entity moves.- Returns:
- True if entity is on ground.
- See Also:
 
- 
isInWaterboolean isInWater()Returns true if the entity is in water.- Returns:
- trueif the entity is in water.
 
- 
getWorldGets the current world this entity resides in- Returns:
- World
 
- 
setRotationvoid setRotation(float yaw, float pitch) Sets the entity's rotation.Note that if the entity is affected by AI, it may override this rotation. - Parameters:
- yaw- the yaw
- pitch- the pitch
 
- 
teleport@Experimental default boolean teleport(@NotNull @NotNull Location location, @NotNull @NotNull TeleportFlag @NotNull ... teleportFlags) Teleports this entity to the given location.- Parameters:
- location- New location to teleport this entity to
- teleportFlags- Flags to be used in this teleportation
- Returns:
- trueif the teleport was successful
 
- 
teleport@Experimental boolean teleport(@NotNull @NotNull Location location, @NotNull @NotNull PlayerTeleportEvent.TeleportCause cause, @NotNull @NotNull TeleportFlag @NotNull ... teleportFlags) Teleports this entity to the given location.- Parameters:
- location- New location to teleport this entity to
- cause- The cause of this teleportation
- teleportFlags- Flags to be used in this teleportation
- Returns:
- trueif the teleport was successful
 
- 
teleportTeleports this entity to the given location. If this entity is riding a vehicle, it will be dismounted prior to teleportation.- Parameters:
- location- New location to teleport this entity to
- Returns:
- trueif the teleport was successful
 
- 
teleportboolean teleport(@NotNull @NotNull Location location, @NotNull @NotNull PlayerTeleportEvent.TeleportCause cause) Teleports this entity to the given location. If this entity is riding a vehicle, it will be dismounted prior to teleportation.- Parameters:
- location- New location to teleport this entity to
- cause- The cause of this teleportation
- Returns:
- trueif the teleport was successful
 
- 
teleportTeleports this entity to the target Entity. If this entity is riding a vehicle, it will be dismounted prior to teleportation.- Parameters:
- destination- Entity to teleport this entity to
- Returns:
- trueif the teleport was successful
 
- 
teleportboolean teleport(@NotNull @NotNull Entity destination, @NotNull @NotNull PlayerTeleportEvent.TeleportCause cause) Teleports this entity to the target Entity. If this entity is riding a vehicle, it will be dismounted prior to teleportation.- Parameters:
- destination- Entity to teleport this entity to
- cause- The cause of this teleportation
- Returns:
- trueif the teleport was successful
 
- 
teleportAsyncLoads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.- Parameters:
- loc- Location to teleport to
- Returns:
- A future that will be completed with the result of the teleport
 
- 
teleportAsync@NotNull default CompletableFuture<Boolean> teleportAsync(@NotNull @NotNull Location loc, @NotNull @NotNull PlayerTeleportEvent.TeleportCause cause) Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.- Parameters:
- loc- Location to teleport to
- cause- Reason for teleport
- Returns:
- A future that will be completed with the result of the teleport
 
- 
getNearbyEntitiesReturns a list of entities within a bounding box centered around this entity- Parameters:
- x- 1/2 the size of the box along x axis
- y- 1/2 the size of the box along y axis
- z- 1/2 the size of the box along z axis
- Returns:
- List<Entity>List of entities nearby
 
- 
getEntityIdint getEntityId()Returns a unique id for this entity- Returns:
- Entity id
 
- 
getFireTicksint getFireTicks()Returns the entity's current fire ticks (ticks before the entity stops being on fire).- Returns:
- int fireTicks
 
- 
getMaxFireTicksint getMaxFireTicks()Returns the entity's maximum fire ticks.- Returns:
- int maxFireTicks
 
- 
setFireTicksvoid setFireTicks(int ticks) Sets the entity's current fire ticks (ticks before the entity stops being on fire).- Parameters:
- ticks- Current ticks remaining
 
- 
setVisualFirevoid setVisualFire(boolean fire) Sets if the entity has visual fire (it will always appear to be on fire).- Parameters:
- fire- whether visual fire is enabled
 
- 
isVisualFireboolean isVisualFire()Gets if the entity has visual fire (it will always appear to be on fire).- Returns:
- whether visual fire is enabled
 
- 
getFreezeTicksint getFreezeTicks()Returns the entity's current freeze ticks (amount of ticks the entity has been in powdered snow).- Returns:
- int freeze ticks
 
- 
getMaxFreezeTicksint getMaxFreezeTicks()Returns the entity's maximum freeze ticks (amount of ticks before it will be fully frozen)- Returns:
- int max freeze ticks
 
- 
setFreezeTicksvoid setFreezeTicks(int ticks) Sets the entity's current freeze ticks (amount of ticks the entity has been in powdered snow).- Parameters:
- ticks- Current ticks
 
- 
isFrozenboolean isFrozen()Gets if the entity is fully frozen (it has been in powdered snow for max freeze ticks).- Returns:
- freeze status
 
- 
isFreezeTickingLockedboolean isFreezeTickingLocked()Gets if the entity currently has its freeze ticks locked to a set amount.This is only set by plugins - Returns:
- locked or not
 
- 
lockFreezeTicksvoid lockFreezeTicks(boolean locked) Sets if the entity currently has its freeze ticks locked, preventing default vanilla freeze tick modification.- Parameters:
- locked- prevent vanilla modification or not
 
- 
removevoid remove()Mark the entity's removal.
- 
isDeadboolean isDead()Returns true if this entity has been marked for removal.- Returns:
- True if it is dead.
 
- 
isValidboolean isValid()Returns false if the entity has died or been despawned for some other reason.- Returns:
- True if valid.
 
- 
getServerGets theServerthat contains this Entity- Specified by:
- getServerin interface- CommandSender
- Returns:
- Server instance running this Entity
 
- 
isPersistentboolean isPersistent()Returns true if the entity gets persisted.By default all entities are persistent. An entity will also not get persisted, if it is riding an entity that is not persistent. The persistent flag on players controls whether or not to save their playerdata file when they quit. If a player is directly or indirectly riding a non-persistent entity, the vehicle at the root and all its passengers won't get persisted. This should not be confused with LivingEntity.setRemoveWhenFarAway(boolean)which controls despawning of living entities.- Returns:
- true if this entity is persistent
 
- 
setPersistentvoid setPersistent(boolean persistent) Sets whether or not the entity gets persisted.- Parameters:
- persistent- the persistence status
- See Also:
 
- 
getPassengerDeprecated.entities may have multiple passengers, usegetPassengers()Gets the primary passenger of a vehicle. For vehicles that could have multiple passengers, this will only return the primary passenger.- Returns:
- an entity
 
- 
setPassengerDeprecated.entities may have multiple passengers, useaddPassenger(org.bukkit.entity.Entity)Set the passenger of a vehicle.- Parameters:
- passenger- The new passenger.
- Returns:
- false if it could not be done for whatever reason
 
- 
getPassengersGets a list of passengers of this vehicle.The returned list will not be directly linked to the entity's current passengers, and no guarantees are made as to its mutability. - Returns:
- list of entities corresponding to current passengers.
 
- 
addPassengerAdd a passenger to the vehicle.- Parameters:
- passenger- The passenger to add
- Returns:
- false if it could not be done for whatever reason
 
- 
removePassengerRemove a passenger from the vehicle.- Parameters:
- passenger- The passenger to remove
- Returns:
- false if it could not be done for whatever reason
 
- 
isEmptyboolean isEmpty()Check if a vehicle has passengers.- Returns:
- True if the vehicle has no passengers.
 
- 
ejectboolean eject()Eject any passenger.- Returns:
- True if there was a passenger.
 
- 
getFallDistancefloat getFallDistance()Returns the distance this entity has fallen- Returns:
- The distance.
 
- 
setFallDistancevoid setFallDistance(float distance) Sets the fall distance for this entity- Parameters:
- distance- The new distance.
 
- 
setLastDamageCauseRecord the lastEntityDamageEventinflicted on this entity- Parameters:
- event- a- EntityDamageEvent
 
- 
getLastDamageCauseRetrieve the lastEntityDamageEventinflicted on this entity. This event may have been cancelled.- Returns:
- the last known EntityDamageEventor null if hitherto unharmed
 
- 
getUniqueIdReturns a unique and persistent id for this entity- Returns:
- unique id
 
- 
getTicksLivedint getTicksLived()Gets the amount of ticks this entity has lived for.This is the equivalent to "age" in entities. - Returns:
- Age of entity
 
- 
setTicksLivedvoid setTicksLived(int value) Sets the amount of ticks this entity has lived for.This is the equivalent to "age" in entities. May not be less than one tick. - Parameters:
- value- Age of entity
 
- 
playEffectPerforms the specifiedEntityEffectfor this entity.This will be viewable to all players near the entity. If the effect is not applicable to this class of entity, it will not play. - Parameters:
- type- Effect to play.
 
- 
getTypeGet the type of the entity.- Returns:
- The entity type.
 
- 
getSwimSoundGet theSoundthis entity makes while swimming.- Returns:
- the swimming sound
 
- 
getSwimSplashSoundGet theSoundthis entity makes when splashing in water. For most entities, this is justSound.ENTITY_GENERIC_SPLASH.- Returns:
- the splash sound
 
- 
getSwimHighSpeedSplashSoundGet theSoundthis entity makes when splashing in water at high speeds. For most entities, this is justSound.ENTITY_GENERIC_SPLASH.- Returns:
- the splash sound
 
- 
isInsideVehicleboolean isInsideVehicle()Returns whether this entity is inside a vehicle.- Returns:
- True if the entity is in a vehicle.
 
- 
leaveVehicleboolean leaveVehicle()Leave the current vehicle. If the entity is currently in a vehicle (and is removed from it), true will be returned, otherwise false will be returned.- Returns:
- True if the entity was in a vehicle.
 
- 
getVehicleGet the vehicle that this entity is inside. If there is no vehicle, null will be returned.- Returns:
- The current vehicle.
 
- 
setCustomNameVisiblevoid setCustomNameVisible(boolean flag) Sets whether or not to display the mob's custom name client side. The name will be displayed above the mob similarly to a player.This value has no effect on players, they will always display their name. - Parameters:
- flag- custom name or not
 
- 
isCustomNameVisibleboolean isCustomNameVisible()Gets whether or not the mob's custom name is displayed client side.This value has no effect on players, they will always display their name. - Returns:
- if the custom name is displayed
 
- 
setVisibleByDefaultDeprecated.draft APISets whether or not this entity is visible by default. If this entity is not visible by default, thenPlayer.showEntity(org.bukkit.plugin.Plugin, org.bukkit.entity.Entity)will need to be called before the entity is visible to a given player.- Parameters:
- visible- default visibility status
 
- 
isVisibleByDefaultDeprecated.draft APIGets whether or not this entity is visible by default. If this entity is not visible by default, thenPlayer.showEntity(org.bukkit.plugin.Plugin, org.bukkit.entity.Entity)will need to be called before the entity is visible to a given player.- Returns:
- default visibility status
 
- 
setGlowingvoid setGlowing(boolean flag) Sets whether the entity has a team colored (default: white) glow. nb: this refers to the 'Glowing' entity property, not whether a glowing potion effect is applied- Parameters:
- flag- if the entity is glowing
 
- 
isGlowingboolean isGlowing()Gets whether the entity is glowing or not. nb: this refers to the 'Glowing' entity property, not whether a glowing potion effect is applied- Returns:
- whether the entity is glowing
 
- 
setInvulnerablevoid setInvulnerable(boolean flag) Sets whether the entity is invulnerable or not.When an entity is invulnerable it can only be damaged by players in creative mode. - Parameters:
- flag- if the entity is invulnerable
 
- 
isInvulnerableboolean isInvulnerable()Gets whether the entity is invulnerable or not.- Returns:
- whether the entity is
 
- 
isSilentboolean isSilent()Gets whether the entity is silent or not.- Returns:
- whether the entity is silent.
 
- 
setSilentvoid setSilent(boolean flag) Sets whether the entity is silent or not.When an entity is silent it will not produce any sound. - Parameters:
- flag- if the entity is silent
 
- 
hasGravityboolean hasGravity()Returns whether gravity applies to this entity.- Returns:
- whether gravity applies
 
- 
setGravityvoid setGravity(boolean gravity) Sets whether gravity applies to this entity.- Parameters:
- gravity- whether gravity should apply
 
- 
getPortalCooldownint getPortalCooldown()Gets the period of time (in ticks) before this entity can use a portal.- Returns:
- portal cooldown ticks
 
- 
setPortalCooldownvoid setPortalCooldown(int cooldown) Sets the period of time (in ticks) before this entity can use a portal.- Parameters:
- cooldown- portal cooldown ticks
 
- 
getScoreboardTagsReturns a set of tags for this entity.
 Entities can have no more than 1024 tags.- Returns:
- a set of tags for this entity
 
- 
addScoreboardTagAdd a tag to this entity.
 Entities can have no more than 1024 tags.- Parameters:
- tag- the tag to add
- Returns:
- true if the tag was successfully added
 
- 
removeScoreboardTagRemoves a given tag from this entity.- Parameters:
- tag- the tag to remove
- Returns:
- true if the tag was successfully removed
 
- 
getPistonMoveReactionReturns the reaction of the entity when moved by a piston.- Returns:
- reaction
 
- 
getFacingGet the closest cardinalBlockFacedirection an entity is currently facing.
 This will not return any non-cardinal directions such asBlockFace.UPorBlockFace.DOWN.
 Hangingentities will override this call and thus their behavior may be different.- Returns:
- the entity's current cardinal facing.
- See Also:
 
- 
getPoseGets the entity's current pose. Note that the pose is only updated at the end of a tick, so may be inconsistent with other methods. egPlayer.isSneaking()being true does not imply the current pose will bePose.SNEAKING- Returns:
- current pose
 
- 
isSneakingboolean isSneaking()Returns if the entity is in sneak mode- Returns:
- true if the entity is in sneak mode
 
- 
setSneakingvoid setSneaking(boolean sneak) Sets the sneak mode the entity.Note: For most Entities this does not update Entity's pose and just makes its name tag less visible. - Parameters:
- sneak- true if the entity should be sneaking
 
- 
getSpawnCategoryGet the category of spawn to which this entity belongs.- Returns:
- the entity´s category spawn
 
- 
spigot- Specified by:
- spigotin interface- CommandSender
 
- 
teamDisplayNameGets the entity's display name formatted with their team prefix/suffix and the entity's default hover/click events.- Returns:
- the team display name
 
- 
asHoverEvent@NotNull default HoverEvent<HoverEvent.ShowEntity> asHoverEvent(@NotNull UnaryOperator<HoverEvent.ShowEntity> op) Description copied from interface:net.kyori.adventure.text.event.HoverEventSourceCreates a hover event with value derived from this object.The event value will be passed through the provided callback to allow transforming the original value of the event. - Specified by:
- asHoverEventin interface- HoverEventSource<HoverEvent.ShowEntity>
- Parameters:
- op- transformation on value
- Returns:
- a hover event
 
- 
getOriginGets the location where this entity originates from.This value can be null if the entity hasn't yet been added to the world. - Returns:
- Location where entity originates or null if not yet added
 
- 
fromMobSpawnerboolean fromMobSpawner()Returns whether this entity was spawned from a mob spawner.- Returns:
- True if entity spawned from a mob spawner
 
- 
getChunkGets the latest chunk an entity is currently or was in.- Returns:
- The current, or most recent chunk if the entity is invalid (which may load the chunk)
 
- 
getEntitySpawnReason- Returns:
- The CreatureSpawnEvent.SpawnReasonthat initially spawned this entity.
 
- 
isUnderWaterboolean isUnderWater()Check if entity is underwater
- 
isInRainboolean isInRain()Check if entity is in rain
- 
isInBubbleColumnboolean isInBubbleColumn()Check if entity is in bubble column
- 
isInWaterOrRainboolean isInWaterOrRain()Check if entity is in water or rain
- 
isInWaterOrBubbleColumnboolean isInWaterOrBubbleColumn()Check if entity is in water or bubble column
- 
isInWaterOrRainOrBubbleColumnboolean isInWaterOrRainOrBubbleColumn()Check if entity is in water or rain or bubble column
- 
isInLavaboolean isInLava()Check if entity is in lava
- 
isTickingboolean isTicking()Check if entity is inside a ticking chunk
- 
getTrackedPlayersReturns a set ofPlayerswithin this entity's tracking range (players that can "see" this entity).- Returns:
- players in tracking range
 
- 
spawnAtSpawns the entity in the world at the givenLocationwith the default spawn reason.This will not spawn the entity if the entity is already spawned or has previously been despawned. Also, this method will fire the same events as a normal entity spawn. - Parameters:
- location- The location to spawn the entity at.
- Returns:
- Whether the entity was successfully spawned.
 
- 
spawnAtboolean spawnAt(@NotNull @NotNull Location location, @NotNull CreatureSpawnEvent.SpawnReason reason) Spawns the entity in the world at the givenLocationwith the reason given.This will not spawn the entity if the entity is already spawned or has previously been despawned. Also, this method will fire the same events as a normal entity spawn. - Parameters:
- location- The location to spawn the entity at.
- reason- The reason for the entity being spawned.
- Returns:
- Whether the entity was successfully spawned.
 
- 
isInPowderedSnowboolean isInPowderedSnow()Check if entity is inside powdered snow.- Returns:
- true if in powdered snow.
 
- 
collidesAtChecks for any collisions with the entity's bounding box at the provided location. This will check for any colliding entities (boats, shulkers) / worldborder / blocks. Does not load chunks that are within the bounding box at the specified location.- Parameters:
- location- the location to check collisions in
- Returns:
- collides or not
 
- 
wouldCollideUsingThis checks using the given boundingbox as the entity's boundingbox if the entity would collide with anything. This will check for any colliding entities (boats, shulkers) / worldborder / blocks. Does not load chunks that are within the bounding box.- Parameters:
- boundingBox- the box to check collisions in
- Returns:
- collides or not
 
- 
getSchedulerReturns the task scheduler for this entity. The entity scheduler can be used to schedule tasks that are guaranteed to always execute on the tick thread that owns the entity.- Returns:
- the task scheduler for this entity.
- See Also:
 
 
- 
getPassengers()