Class GlowEntity

java.lang.Object
net.glowstone.entity.GlowEntity
All Implemented Interfaces:
net.kyori.adventure.audience.Audience, 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

public abstract class GlowEntity extends Object implements org.bukkit.entity.Entity
Represents some entity in the world such as an item on the floor or a player.
Author:
Graham Edgecombe
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.bukkit.entity.Entity

    org.bukkit.entity.Entity.Spigot
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected 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.
    The entity's bounding box, or null if it has no physical presence.
    static 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 org.bukkit.Location
    The current position.
    protected MetadataMap
    The entity's metadata.
    protected boolean
     
    protected org.bukkit.Location
    The position in the last cycle.
    protected boolean
    Whether this entity was forcibly removed from the world.
    protected 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 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 ReadWriteLock
    Lock to prevent concurrent modifications affected by switching worlds.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GlowEntity​(org.bukkit.Location location)
    Creates an entity and adds it to the specified world.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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
     
    void
    collide​(org.bukkit.block.Block block)
    Collide with the target block.
    List<com.flowpowered.network.Message>
    Creates a List of Message which can be sent to a client directly after the entity is spawned.
    abstract List<com.flowpowered.network.Message>
    Creates a list of Messages which can be sent to a client to spawn this entity.
    List<com.flowpowered.network.Message>
    Creates a Message 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
     
    boolean
     
    boolean
    equals​(Object obj)
     
    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
     
     
    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.
    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.
    org.bukkit.Location
     
    org.bukkit.Location
    getLocation​(org.bukkit.Location loc)
     
    int
     
     
    List<org.bukkit.metadata.MetadataValue>
    getMetadata​(String metadataKey)
     
    org.bukkit.Location
     
     
    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
     
     
    The server this entity belongs to.
    int
    A counter of how long this entity has existed.
    org.bukkit.entity.EntityType
     
     
    The entity this entity is currently riding.
    org.bukkit.util.Vector
     
    double
     
    The world this entity belongs to.
    protected boolean
    If true, setRawLocation(Location, boolean) with fall true will call setOnGround(boolean) according to whether or not our location is inside a solid block.
    boolean
     
    boolean
     
    int
     
    boolean
    hasMetadata​(String metadataKey)
     
    boolean
    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
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
    isInMaterial​(org.bukkit.Material type)
     
    boolean
     
    boolean
     
    boolean
    Whether this entity is invulnerable.
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
    A flag indicting if the entity is on the ground.
    boolean
    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
     
    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
     
    boolean
    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
    playEffect​(org.bukkit.EntityEffect type)
     
    void
    playEffectKnownAndSelf​(org.bukkit.EntityEffect type)
     
    void
    Called every game cycle.
    protected void
     
    void
     
    void
    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
    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 void
    setBoundingBox​(double xz, double y)
     
    void
     
    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
    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
    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)
     
    boolean
    Checks whether this entity should be saved as part of the world.
    @NotNull org.bukkit.entity.Entity.Spigot
     
    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.
     
    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, hideBossBar, openBook, openBook, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, showBossBar, showTitle, stopSound

    Methods inherited from interface org.bukkit.command.CommandSender

    sendMessage, sendMessage, sendMessage

    Methods inherited from interface org.bukkit.entity.Entity

    asHoverEvent, teleportAsync, teleportAsync

    Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource

    asHoverEvent
  • Field Details

    • ENTITY_ID_NOBODY

      public static final int ENTITY_ID_NOBODY
      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).
      See Also:
      Constant Field Values
    • server

      protected final GlowServer server
      The server this entity belongs to.
    • metadata

      protected final MetadataMap metadata
      The entity's metadata.
    • location

      protected final org.bukkit.Location location
      The current position.
    • previousLocation

      protected final org.bukkit.Location previousLocation
      The position in the last cycle.
    • velocity

      protected final org.bukkit.util.Vector velocity
      The entity's velocity, applied each tick.
    • worldLock

      protected final ReadWriteLock worldLock
      Lock to prevent concurrent modifications affected by switching worlds.
    • world

      protected GlowWorld world
      The world this entity belongs to. Guarded by worldLock.
    • active

      protected boolean active
      A flag indicating if this entity is currently active.
    • entityId

      protected int entityId
      This entity's current identifier for its world.
    • teleported

      protected boolean teleported
      Whether the entity should have its position resent as if teleported.
    • velocityChanged

      protected boolean velocityChanged
      Whether the entity should have its velocity resent.
    • ticksLived

      protected int ticksLived
      A counter of how long this entity has existed.
    • vehicle

      protected GlowEntity vehicle
      The entity this entity is currently riding.
    • boundingBox

      protected EntityBoundingBox boundingBox
      The entity's bounding box, or null if it has no physical presence.
    • passengerChanged

      protected boolean passengerChanged
    • removed

      protected boolean removed
      Whether this entity was forcibly removed from the world.
    • airDrag

      protected 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.
    • liquidDrag

      protected 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.
    • gravityAccel

      protected org.bukkit.util.Vector gravityAccel
      Gravity acceleration applied each tick. The default value (0,0,0) indicates no gravity acceleration.
    • slipMultiplier

      protected double slipMultiplier
      The slipperiness multiplier applied according to the block this entity was on.
    • applyDragBeforeAccel

      protected boolean applyDragBeforeAccel
      If 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

      public String toString()
      Overrides:
      toString in class Object
    • sendMessage

      public void sendMessage(String message)
      Specified by:
      sendMessage in interface org.bukkit.command.CommandSender
    • sendMessage

      public void sendMessage(String[] strings)
      Specified by:
      sendMessage in interface org.bukkit.command.CommandSender
    • sendMessage

      public void sendMessage(@Nullable @Nullable UUID sender, @NotNull @NotNull String message)
      Specified by:
      sendMessage in interface org.bukkit.command.CommandSender
    • sendMessage

      public void sendMessage(@Nullable @Nullable UUID sender, @NotNull @NotNull String[] messages)
      Specified by:
      sendMessage in interface org.bukkit.command.CommandSender
    • getName

      public String getName()
      Specified by:
      getName in interface org.bukkit.command.CommandSender
    • getUniqueId

      public UUID getUniqueId()
      Specified by:
      getUniqueId in interface org.bukkit.entity.Entity
    • setUniqueId

      public void setUniqueId(UUID uuid)
      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 interface org.bukkit.entity.Entity
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface org.bukkit.entity.Entity
    • getLocation

      public org.bukkit.Location getLocation()
      Specified by:
      getLocation in interface org.bukkit.entity.Entity
    • getLocation

      public org.bukkit.Location getLocation(org.bukkit.Location loc)
      Specified by:
      getLocation in interface org.bukkit.entity.Entity
    • getChunk

      public org.bukkit.Chunk getChunk()
      Specified by:
      getChunk in interface org.bukkit.entity.Entity
    • getEntitySpawnReason

      public @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason()
      Specified by:
      getEntitySpawnReason in interface org.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 interface org.bukkit.entity.Entity
      Returns:
      The intercardinal BlockFace of this entity
    • getPose

      @NotNull public @NotNull org.bukkit.entity.Pose getPose()
      Specified by:
      getPose in interface org.bukkit.entity.Entity
    • spigot

      @NotNull public @NotNull org.bukkit.entity.Entity.Spigot spigot()
      Specified by:
      spigot in interface org.bukkit.command.CommandSender
      Specified by:
      spigot in interface org.bukkit.entity.Entity
    • getVelocity

      public org.bukkit.util.Vector getVelocity()
      Specified by:
      getVelocity in interface org.bukkit.entity.Entity
    • setVelocity

      public void setVelocity(org.bukkit.util.Vector velocity)
      Specified by:
      setVelocity in interface org.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 interface org.bukkit.entity.Entity
    • teleport

      public boolean teleport(org.bukkit.entity.Entity destination)
      Specified by:
      teleport in interface org.bukkit.entity.Entity
    • teleport

      public boolean teleport(org.bukkit.Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause)
      Specified by:
      teleport in interface org.bukkit.entity.Entity
    • teleport

      public boolean teleport(org.bukkit.entity.Entity destination, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause)
      Specified by:
      teleport in interface org.bukkit.entity.Entity
    • isWithinDistance

      public boolean isWithinDistance(GlowEntity other)
      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 interface org.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) with fall true will call setOnGround(boolean) according to whether or not our location is inside a solid block.
      Returns:
      true to call setOnGround(boolean) from setRawLocation(Location, boolean); false otherwise
    • createSpawnMessage

      public abstract List<com.flowpowered.network.Message> createSpawnMessage()
      Creates a list of Messages 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

      public List<com.flowpowered.network.Message> createAfterSpawnMessage(GlowSession session)
      Creates a List of Message 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

      public List<com.flowpowered.network.Message> createUpdateMessage(GlowSession session)
      Creates a Message 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 interface org.bukkit.entity.Entity
    • getBoundingBox

      public @NotNull org.bukkit.util.BoundingBox getBoundingBox()
      Specified by:
      getBoundingBox in interface org.bukkit.entity.Entity
    • setRotation

      public void setRotation(float yaw, float pitch)
      Specified by:
      setRotation in interface org.bukkit.entity.Entity
    • getHeight

      public double getHeight()
      Specified by:
      getHeight in interface org.bukkit.entity.Entity
    • intersects

      public boolean intersects(BoundingBox box)
    • pulsePhysics

      protected void pulsePhysics()
    • collide

      public void collide(org.bukkit.block.Block block)
      Collide with the target block.
      Parameters:
      block - a block whose type Material.isOccluding()
    • updateBoundingBox

      protected void updateBoundingBox()
    • getMaxFireTicks

      public int getMaxFireTicks()
      Specified by:
      getMaxFireTicks in interface org.bukkit.entity.Entity
    • setFallDistance

      public void setFallDistance(float distance)
      Specified by:
      setFallDistance in interface org.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 interface org.bukkit.entity.Entity
    • getNearbyEntities

      public List<org.bukkit.entity.Entity> getNearbyEntities(double x, double y, double z)
      Specified by:
      getNearbyEntities in interface org.bukkit.entity.Entity
    • playEffect

      public void playEffect(org.bukkit.EntityEffect type)
      Specified by:
      playEffect in interface org.bukkit.entity.Entity
    • playEffectKnownAndSelf

      public void playEffectKnownAndSelf(org.bukkit.EntityEffect type)
    • getType

      public org.bukkit.entity.EntityType getType()
      Specified by:
      getType in interface org.bukkit.entity.Entity
    • isInsideVehicle

      public boolean isInsideVehicle()
      Specified by:
      isInsideVehicle in interface org.bukkit.entity.Entity
    • leaveVehicle

      public boolean leaveVehicle()
      Specified by:
      leaveVehicle in interface org.bukkit.entity.Entity
    • customName

      @Nullable public @Nullable net.kyori.adventure.text.Component customName()
      Specified by:
      customName in interface org.bukkit.Nameable
    • customName

      public void customName(@Nullable @Nullable net.kyori.adventure.text.Component component)
      Specified by:
      customName in interface org.bukkit.Nameable
    • getCustomName

      public String getCustomName()
      Specified by:
      getCustomName in interface org.bukkit.Nameable
    • setCustomName

      public void setCustomName(String name)
      Specified by:
      setCustomName in interface org.bukkit.Nameable
    • isCustomNameVisible

      public boolean isCustomNameVisible()
      Specified by:
      isCustomNameVisible in interface org.bukkit.entity.Entity
    • setCustomNameVisible

      public void setCustomNameVisible(boolean flag)
      Specified by:
      setCustomNameVisible in interface org.bukkit.entity.Entity
    • isGlowing

      public boolean isGlowing()
      Specified by:
      isGlowing in interface org.bukkit.entity.Entity
    • setGlowing

      public void setGlowing(boolean glowing)
      Specified by:
      setGlowing in interface org.bukkit.entity.Entity
    • getPassenger

      public org.bukkit.entity.Entity getPassenger()
      Specified by:
      getPassenger in interface org.bukkit.entity.Entity
    • getPassengers

      public List<org.bukkit.entity.Entity> getPassengers()
      Specified by:
      getPassengers in interface org.bukkit.entity.Entity
    • removePassenger

      public boolean removePassenger(org.bukkit.entity.Entity passenger)
      Specified by:
      removePassenger in interface org.bukkit.entity.Entity
    • addPassenger

      public boolean addPassenger(org.bukkit.entity.Entity passenger)
      Specified by:
      addPassenger in interface org.bukkit.entity.Entity
    • setPassenger

      public boolean setPassenger(org.bukkit.entity.Entity newPassenger)
      Specified by:
      setPassenger in interface org.bukkit.entity.Entity
    • getMountLocation

      public org.bukkit.Location getMountLocation()
    • getDismountLocation

      public org.bukkit.Location getDismountLocation()
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.bukkit.entity.Entity
    • eject

      public boolean eject()
      Specified by:
      eject in interface org.bukkit.entity.Entity
    • hasFriction

      public boolean hasFriction()
    • hasGravity

      public boolean hasGravity()
      Specified by:
      hasGravity in interface org.bukkit.entity.Entity
    • getScoreboardTags

      public Set<String> getScoreboardTags()
      Specified by:
      getScoreboardTags in interface org.bukkit.entity.Entity
    • addScoreboardTag

      public boolean addScoreboardTag(String tag)
      Specified by:
      addScoreboardTag in interface org.bukkit.entity.Entity
    • removeScoreboardTag

      public boolean removeScoreboardTag(String tag)
      Specified by:
      removeScoreboardTag in interface org.bukkit.entity.Entity
    • fromMobSpawner

      public boolean fromMobSpawner()
      Specified by:
      fromMobSpawner in interface org.bukkit.entity.Entity
    • getPistonMoveReaction

      public org.bukkit.block.PistonMoveReaction getPistonMoveReaction()
      Specified by:
      getPistonMoveReaction in interface org.bukkit.entity.Entity
    • isSilent

      public boolean isSilent()
      Specified by:
      isSilent in interface org.bukkit.entity.Entity
    • setSilent

      public void setSilent(boolean silent)
      Specified by:
      setSilent in interface org.bukkit.entity.Entity
    • setMetadata

      public void setMetadata(String metadataKey, org.bukkit.metadata.MetadataValue newMetadataValue)
      Specified by:
      setMetadata in interface org.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

      public MetadataMap getMetadata()
    • getMetadata

      public List<org.bukkit.metadata.MetadataValue> getMetadata(String metadataKey)
      Specified by:
      getMetadata in interface org.bukkit.metadata.Metadatable
    • hasMetadata

      public boolean hasMetadata(String metadataKey)
      Specified by:
      hasMetadata in interface org.bukkit.metadata.Metadatable
    • removeMetadata

      public void removeMetadata(String metadataKey, org.bukkit.plugin.Plugin owningPlugin)
      Specified by:
      removeMetadata in interface org.bukkit.metadata.Metadatable
    • isPermissionSet

      public boolean isPermissionSet(String s)
      Specified by:
      isPermissionSet in interface org.bukkit.permissions.Permissible
    • isPermissionSet

      public boolean isPermissionSet(org.bukkit.permissions.Permission permission)
      Specified by:
      isPermissionSet in interface org.bukkit.permissions.Permissible
    • hasPermission

      public boolean hasPermission(String s)
      Specified by:
      hasPermission in interface org.bukkit.permissions.Permissible
    • hasPermission

      public boolean hasPermission(org.bukkit.permissions.Permission permission)
      Specified by:
      hasPermission in interface org.bukkit.permissions.Permissible
    • addAttachment

      public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String s, boolean b)
      Specified by:
      addAttachment in interface org.bukkit.permissions.Permissible
    • addAttachment

      public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin)
      Specified by:
      addAttachment in interface org.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 interface org.bukkit.permissions.Permissible
    • addAttachment

      public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, int i)
      Specified by:
      addAttachment in interface org.bukkit.permissions.Permissible
    • removeAttachment

      public void removeAttachment(org.bukkit.permissions.PermissionAttachment permissionAttachment)
      Specified by:
      removeAttachment in interface org.bukkit.permissions.Permissible
    • recalculatePermissions

      public void recalculatePermissions()
      Specified by:
      recalculatePermissions in interface org.bukkit.permissions.Permissible
    • getEffectivePermissions

      public Set<org.bukkit.permissions.PermissionAttachmentInfo> getEffectivePermissions()
      Specified by:
      getEffectivePermissions in interface org.bukkit.permissions.Permissible
    • entityInteract

      public boolean entityInteract(GlowPlayer player, InteractEntityMessage message)
    • isPersistent

      public boolean isPersistent()
      Specified by:
      isPersistent in interface org.bukkit.entity.Entity
    • setPersistent

      public void setPersistent(boolean persistent)
      Specified by:
      setPersistent in interface org.bukkit.entity.Entity
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isLeashed

      public boolean isLeashed()
    • getLeashHolder

      @NotNull public @NotNull org.bukkit.entity.Entity getLeashHolder() throws IllegalStateException
      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

      public void setLeashHolderUniqueId(UUID uniqueId)
      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 interface org.bukkit.entity.Entity
    • isInRain

      public boolean isInRain()
      Specified by:
      isInRain in interface org.bukkit.entity.Entity
    • isInBubbleColumn

      public boolean isInBubbleColumn()
      Specified by:
      isInBubbleColumn in interface org.bukkit.entity.Entity
    • isInWaterOrRain

      public boolean isInWaterOrRain()
      Specified by:
      isInWaterOrRain in interface org.bukkit.entity.Entity
    • isInWaterOrBubbleColumn

      public boolean isInWaterOrBubbleColumn()
      Specified by:
      isInWaterOrBubbleColumn in interface org.bukkit.entity.Entity
    • isInWaterOrRainOrBubbleColumn

      public boolean isInWaterOrRainOrBubbleColumn()
      Specified by:
      isInWaterOrRainOrBubbleColumn in interface org.bukkit.entity.Entity
    • isInLava

      public boolean isInLava()
      Specified by:
      isInLava in interface org.bukkit.entity.Entity
    • getPersistentDataContainer

      @NotNull public @NotNull org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()
      Specified by:
      getPersistentDataContainer in interface org.bukkit.persistence.PersistentDataHolder
    • getServer

      public GlowServer getServer()
      The server this entity belongs to.
      Specified by:
      getServer in interface org.bukkit.command.CommandSender
      Specified by:
      getServer in interface org.bukkit.entity.Entity
    • getOrigin

      public org.bukkit.Location getOrigin()
      The original location of this entity.
      Specified by:
      getOrigin in interface org.bukkit.entity.Entity
    • getLeashedEntities

      public List<GlowEntity> getLeashedEntities()
      All entities that currently have this entity as leash holder.
    • getCustomTags

      public List<String> getCustomTags()
      List of custom String data for the entity.
    • getWorld

      public GlowWorld getWorld()
      The world this entity belongs to. Guarded by worldLock.
      Specified by:
      getWorld in interface org.bukkit.entity.Entity
    • getEntityId

      public int getEntityId()
      This entity's current identifier for its world.
      Specified by:
      getEntityId in interface org.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 interface org.bukkit.entity.Entity
    • setTicksLived

      public void setTicksLived(int ticksLived)
      A counter of how long this entity has existed.
      Specified by:
      setTicksLived in interface org.bukkit.entity.Entity
    • getVehicle

      public GlowEntity getVehicle()
      The entity this entity is currently riding.
      Specified by:
      getVehicle in interface org.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 interface org.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 interface org.bukkit.entity.Entity
    • isOnGround

      public boolean isOnGround()
      A flag indicting if the entity is on the ground.
      Specified by:
      isOnGround in interface org.bukkit.entity.Entity
    • getFallDistance

      public float getFallDistance()
      The distance the entity is currently falling without touching the ground.
      Specified by:
      getFallDistance in interface org.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 interface org.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 interface org.bukkit.entity.Entity
    • setGravity

      public void setGravity(boolean gravity)
      Whether gravity applies to the entity.
      Specified by:
      setGravity in interface org.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 interface org.bukkit.entity.Entity
    • setInvulnerable

      public void setInvulnerable(boolean invulnerable)
      Whether this entity is invulnerable.
      Specified by:
      setInvulnerable in interface org.bukkit.entity.Entity
    • getPortalCooldown

      public int getPortalCooldown()
      The Nether portal cooldown for the entity.
      Specified by:
      getPortalCooldown in interface org.bukkit.entity.Entity
    • setPortalCooldown

      public void setPortalCooldown(int portalCooldown)
      The Nether portal cooldown for the entity.
      Specified by:
      setPortalCooldown in interface org.bukkit.entity.Entity
    • isOp

      public boolean isOp()
      Whether this entity has operator permissions.
      Specified by:
      isOp in interface org.bukkit.permissions.ServerOperator
    • setOp

      public void setOp(boolean op)
      Whether this entity has operator permissions.
      Specified by:
      setOp in interface org.bukkit.permissions.ServerOperator