Class GlowItem

java.lang.Object
net.glowstone.entity.GlowEntity
net.glowstone.entity.objects.GlowItem
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.entity.Item, org.bukkit.metadata.Metadatable, org.bukkit.Nameable, org.bukkit.permissions.Permissible, org.bukkit.permissions.ServerOperator, org.bukkit.persistence.PersistentDataHolder

public class GlowItem extends GlowEntity implements org.bukkit.entity.Item
Represents an item that is also an GlowEntity within the world.
  • Constructor Details

    • GlowItem

      public GlowItem(org.bukkit.Location location, org.bukkit.inventory.ItemStack item)
      Creates a new item entity.
      Parameters:
      location - The location of the entity.
      item - The item stack the entity is carrying.
  • Method Details

    • getType

      @NotNull public @NotNull org.bukkit.entity.EntityType getType()
      Specified by:
      getType in interface org.bukkit.entity.Entity
      Overrides:
      getType in class GlowEntity
    • 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 GlowEntity
    • pulsePhysics

      protected void pulsePhysics()
      Overrides:
      pulsePhysics in class GlowEntity
    • 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.
    • getItemStack

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getItemStack()
      Specified by:
      getItemStack in interface org.bukkit.entity.Item
    • setItemStack

      public void setItemStack(@NotNull @NotNull org.bukkit.inventory.ItemStack stack)
      Specified by:
      setItemStack in interface org.bukkit.entity.Item
    • canMobPickup

      public boolean canMobPickup()
      Specified by:
      canMobPickup in interface org.bukkit.entity.Item
    • canPlayerPickup

      public boolean canPlayerPickup()
      Specified by:
      canPlayerPickup in interface org.bukkit.entity.Item
    • willAge

      public boolean willAge()
      Specified by:
      willAge in interface org.bukkit.entity.Item
    • getPickupDelay

      public int getPickupDelay()
      The remaining delay until this item may be picked up.
      Specified by:
      getPickupDelay in interface org.bukkit.entity.Item
    • setPickupDelay

      public void setPickupDelay(int pickupDelay)
      The remaining delay until this item may be picked up.
      Specified by:
      setPickupDelay in interface org.bukkit.entity.Item
    • setBias

      public void setBias(GlowPlayer bias)
      A player to bias this item's pickup selection towards.
    • setCanMobPickup

      public void setCanMobPickup(boolean canMobPickup)
      Specified by:
      setCanMobPickup in interface org.bukkit.entity.Item
    • setCanPlayerPickup

      public void setCanPlayerPickup(boolean canPlayerPickup)
      Specified by:
      setCanPlayerPickup in interface org.bukkit.entity.Item
    • setWillAge

      public void setWillAge(boolean willAge)
      Specified by:
      setWillAge in interface org.bukkit.entity.Item
    • getOwner

      @Nullable public UUID getOwner()
      Specified by:
      getOwner in interface org.bukkit.entity.Item
    • setOwner

      public void setOwner(@Nullable UUID owner)
      Specified by:
      setOwner in interface org.bukkit.entity.Item
    • getThrower

      @Nullable public UUID getThrower()
      Specified by:
      getThrower in interface org.bukkit.entity.Item
    • setThrower

      public void setThrower(@Nullable UUID thrower)
      Specified by:
      setThrower in interface org.bukkit.entity.Item