Class GlowHumanEntity

All Implemented Interfaces:
net.kyori.adventure.audience.Audience, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, org.bukkit.attribute.Attributable, org.bukkit.command.CommandSender, org.bukkit.entity.AnimalTamer, org.bukkit.entity.Damageable, org.bukkit.entity.Entity, org.bukkit.entity.HumanEntity, org.bukkit.entity.LivingEntity, org.bukkit.inventory.InventoryHolder, org.bukkit.metadata.Metadatable, org.bukkit.Nameable, org.bukkit.permissions.Permissible, org.bukkit.permissions.ServerOperator, org.bukkit.persistence.PersistentDataHolder, org.bukkit.projectiles.ProjectileSource
Direct Known Subclasses:
GlowPlayer

public abstract class GlowHumanEntity extends GlowLivingEntity implements org.bukkit.entity.HumanEntity
Represents a human entity, such as an NPC or a player.
  • Field Details

    • sleeping

      protected boolean sleeping
      Whether this human is sleeping or not.
    • permissions

      protected org.bukkit.permissions.PermissibleBase permissions
      This human's PermissibleBase for permissions.
  • Constructor Details

    • GlowHumanEntity

      public GlowHumanEntity(org.bukkit.Location location, GlowPlayerProfile profile)
      Creates a human within the specified world and with the specified name.
      Parameters:
      location - The location.
      profile - The human's profile with name and UUID information.
  • Method Details

    • createSpawnMessage

      public List<com.flowpowered.network.Message> createSpawnMessage()
      Description copied from class: GlowEntity
      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.
      Specified by:
      createSpawnMessage in class GlowEntity
      Returns:
      A list of messages which can spawn this entity.
    • pulse

      public void pulse()
      Description copied from class: GlowEntity
      Called every game cycle. Subclasses should implement this to implement periodic functionality e.g. mob AI.
      Overrides:
      pulse in class GlowLivingEntity
    • getName

      public String getName()
      Specified by:
      getName in interface org.bukkit.entity.AnimalTamer
      Specified by:
      getName in interface org.bukkit.command.CommandSender
      Specified by:
      getName in interface org.bukkit.entity.HumanEntity
      Overrides:
      getName in class GlowEntity
    • getUniqueId

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

      public void setUniqueId(UUID uuid)
      Description copied from class: GlowEntity
      Sets this entity's unique identifier if possible.
      Overrides:
      setUniqueId in class GlowEntity
      Parameters:
      uuid - The new UUID. Must not be null.
    • isBlocking

      public boolean isBlocking()
      Specified by:
      isBlocking in interface org.bukkit.entity.HumanEntity
    • getExpToLevel

      public int getExpToLevel()
      Specified by:
      getExpToLevel in interface org.bukkit.entity.HumanEntity
    • getEquipment

      public org.bukkit.inventory.EntityEquipment getEquipment()
      Specified by:
      getEquipment in interface org.bukkit.entity.LivingEntity
      Overrides:
      getEquipment in class GlowLivingEntity
    • setFireTicks

      public void setFireTicks(int ticks)
      Description copied from class: GlowEntity
      How long the entity has been on fire, or 0 if it is not.
      Specified by:
      setFireTicks in interface org.bukkit.entity.Entity
      Overrides:
      setFireTicks in class GlowEntity
    • isPermissionSet

      public boolean isPermissionSet(String name)
      Specified by:
      isPermissionSet in interface org.bukkit.permissions.Permissible
      Overrides:
      isPermissionSet in class GlowEntity
    • isPermissionSet

      public boolean isPermissionSet(org.bukkit.permissions.Permission perm)
      Specified by:
      isPermissionSet in interface org.bukkit.permissions.Permissible
      Overrides:
      isPermissionSet in class GlowEntity
    • hasPermission

      public boolean hasPermission(String name)
      Specified by:
      hasPermission in interface org.bukkit.permissions.Permissible
      Overrides:
      hasPermission in class GlowEntity
    • hasPermission

      public boolean hasPermission(org.bukkit.permissions.Permission perm)
      Specified by:
      hasPermission in interface org.bukkit.permissions.Permissible
      Overrides:
      hasPermission in class GlowEntity
    • addAttachment

      public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin)
      Specified by:
      addAttachment in interface org.bukkit.permissions.Permissible
      Overrides:
      addAttachment in class GlowEntity
    • addAttachment

      public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, int ticks)
      Specified by:
      addAttachment in interface org.bukkit.permissions.Permissible
      Overrides:
      addAttachment in class GlowEntity
    • addAttachment

      public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String name, boolean value)
      Specified by:
      addAttachment in interface org.bukkit.permissions.Permissible
      Overrides:
      addAttachment in class GlowEntity
    • addAttachment

      public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String name, boolean value, int ticks)
      Specified by:
      addAttachment in interface org.bukkit.permissions.Permissible
      Overrides:
      addAttachment in class GlowEntity
    • removeAttachment

      public void removeAttachment(org.bukkit.permissions.PermissionAttachment attachment)
      Specified by:
      removeAttachment in interface org.bukkit.permissions.Permissible
      Overrides:
      removeAttachment in class GlowEntity
    • recalculatePermissions

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

      public Set<org.bukkit.permissions.PermissionAttachmentInfo> getEffectivePermissions()
      Specified by:
      getEffectivePermissions in interface org.bukkit.permissions.Permissible
      Overrides:
      getEffectivePermissions in class GlowEntity
    • setOp

      public void setOp(boolean value)
      Description copied from class: GlowEntity
      Whether this entity has operator permissions.
      Specified by:
      setOp in interface org.bukkit.permissions.ServerOperator
      Overrides:
      setOp in class GlowEntity
    • canTakeDamage

      public boolean canTakeDamage(org.bukkit.event.entity.EntityDamageEvent.DamageCause damageCause)
      Description copied from class: GlowLivingEntity
      Get whether this entity should take damage from the specified source.

      Usually used to check environmental sources such as drowning.

      Overrides:
      canTakeDamage in class GlowLivingEntity
      Parameters:
      damageCause - the damage source to check
      Returns:
      whether this entity can take damage from the source
    • getItemInHand

      public org.bukkit.inventory.ItemStack getItemInHand()
      Specified by:
      getItemInHand in interface org.bukkit.entity.HumanEntity
    • setItemInHand

      public void setItemInHand(org.bukkit.inventory.ItemStack item)
      Specified by:
      setItemInHand in interface org.bukkit.entity.HumanEntity
    • setWindowProperty

      public boolean setWindowProperty(org.bukkit.inventory.InventoryView.Property prop, int value)
      Specified by:
      setWindowProperty in interface org.bukkit.entity.HumanEntity
    • openInventory

      public org.bukkit.inventory.InventoryView openInventory(org.bukkit.inventory.Inventory inventory)
      Specified by:
      openInventory in interface org.bukkit.entity.HumanEntity
    • openInventory

      public void openInventory(org.bukkit.inventory.InventoryView inventory)
      Specified by:
      openInventory in interface org.bukkit.entity.HumanEntity
    • openWorkbench

      public org.bukkit.inventory.InventoryView openWorkbench(org.bukkit.Location location, boolean force)
      Specified by:
      openWorkbench in interface org.bukkit.entity.HumanEntity
    • openEnchanting

      public org.bukkit.inventory.InventoryView openEnchanting(org.bukkit.Location location, boolean force)
      Specified by:
      openEnchanting in interface org.bukkit.entity.HumanEntity
    • closeInventory

      public void closeInventory()
      Specified by:
      closeInventory in interface org.bukkit.entity.HumanEntity
    • closeInventory

      public void closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason)
      Specified by:
      closeInventory in interface org.bukkit.entity.HumanEntity
    • dropItemInHand

      public void dropItemInHand(boolean wholeStack)
      Drops the item this entity currently has in its hands and remove the item from the HumanEntity's inventory.
      Parameters:
      wholeStack - True if the whole stack should be dropped
    • drop

      public GlowItem drop(org.bukkit.inventory.ItemStack stack)
      Spawns a new GlowItem in the world, as if this HumanEntity had dropped it.

      Note that this does NOT remove the item from the inventory.

      Parameters:
      stack - The item to drop
      Returns:
      the GlowItem that was generated, or null if the spawning was cancelled
      Throws:
      IllegalArgumentException - if the stack is empty
    • getShoulderEntityLeft

      public org.bukkit.entity.Entity getShoulderEntityLeft()
      Specified by:
      getShoulderEntityLeft in interface org.bukkit.entity.HumanEntity
    • setShoulderEntityLeft

      public void setShoulderEntityLeft(org.bukkit.entity.Entity entity)
      Specified by:
      setShoulderEntityLeft in interface org.bukkit.entity.HumanEntity
    • getShoulderEntityRight

      public org.bukkit.entity.Entity getShoulderEntityRight()
      Specified by:
      getShoulderEntityRight in interface org.bukkit.entity.HumanEntity
    • setShoulderEntityRight

      public void setShoulderEntityRight(org.bukkit.entity.Entity entity)
      Specified by:
      setShoulderEntityRight in interface org.bukkit.entity.HumanEntity
    • releaseLeftShoulderEntity

      public org.bukkit.entity.Entity releaseLeftShoulderEntity()
      Specified by:
      releaseLeftShoulderEntity in interface org.bukkit.entity.HumanEntity
    • releaseRightShoulderEntity

      public org.bukkit.entity.Entity releaseRightShoulderEntity()
      Specified by:
      releaseRightShoulderEntity in interface org.bukkit.entity.HumanEntity
    • getLeftShoulderTag

      public CompoundTag getLeftShoulderTag()
    • setLeftShoulderTag

      public void setLeftShoulderTag(CompoundTag tag)
    • getRightShoulderTag

      public CompoundTag getRightShoulderTag()
    • setRightShoulderTag

      public void setRightShoulderTag(CompoundTag tag)
    • openSign

      public void openSign(org.bukkit.block.Sign sign)
      Specified by:
      openSign in interface org.bukkit.entity.HumanEntity
    • getProfile

      public GlowPlayerProfile getProfile()
      The player profile with name and UUID information.
    • getInventory

      public GlowPlayerInventory getInventory()
      The inventory of this human.
      Specified by:
      getInventory in interface org.bukkit.entity.HumanEntity
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
    • getEnderChest

      public GlowInventory getEnderChest()
      The ender chest inventory of this human.
      Specified by:
      getEnderChest in interface org.bukkit.entity.HumanEntity
    • isSleeping

      public boolean isSleeping()
      Whether this human is sleeping or not.
      Specified by:
      isSleeping in interface org.bukkit.entity.LivingEntity
      Overrides:
      isSleeping in class GlowLivingEntity
    • getItemOnCursor

      public org.bukkit.inventory.ItemStack getItemOnCursor()
      The item the player has on their cursor.
      Specified by:
      getItemOnCursor in interface org.bukkit.entity.HumanEntity
    • setItemOnCursor

      public void setItemOnCursor(org.bukkit.inventory.ItemStack itemOnCursor)
      The item the player has on their cursor.
      Specified by:
      setItemOnCursor in interface org.bukkit.entity.HumanEntity
    • getSleepTicks

      public int getSleepTicks()
      How long this human has been sleeping.
      Specified by:
      getSleepTicks in interface org.bukkit.entity.HumanEntity
    • isOp

      public boolean isOp()
      Whether this human is considered an op.
      Specified by:
      isOp in interface org.bukkit.permissions.ServerOperator
      Overrides:
      isOp in class GlowEntity
    • getGameMode

      public org.bukkit.GameMode getGameMode()
      The player's active game mode.
      Specified by:
      getGameMode in interface org.bukkit.entity.HumanEntity
    • setGameMode

      public void setGameMode(org.bukkit.GameMode gameMode)
      The player's active game mode.
      Specified by:
      setGameMode in interface org.bukkit.entity.HumanEntity
    • getOpenInventory

      public org.bukkit.inventory.InventoryView getOpenInventory()
      The player's currently open inventory.
      Specified by:
      getOpenInventory in interface org.bukkit.entity.HumanEntity
    • getXpSeed

      public int getXpSeed()
      The player's xpSeed. Used for calculation of enchantments.
    • setXpSeed

      public void setXpSeed(int xpSeed)
      The player's xpSeed. Used for calculation of enchantments.