Interface IEntityItem<T extends net.minecraft.entity.item.EntityItem>

  • Type Parameters:
    T - The underlying Minecraft EntityItem type.
    All Superinterfaces:
    IEntity<T>

    public interface IEntityItem<T extends net.minecraft.entity.item.EntityItem>
    extends IEntity<T>
    Represents an item entity in the world. Provides methods to manage pickup delay, age, ownership, and the contained item.
    • Method Detail

      • getOwner

        java.lang.String getOwner()
        Returns the owner name of the item. Only the owner can pick the item up (unless the age is very low).
        Returns:
        the owner's name.
      • setOwner

        void setOwner​(java.lang.String name)
        Sets the owner name of the item.
        Parameters:
        name - the owner's name.
      • getThrower

        java.lang.String getThrower()
        Returns the thrower (entity that threw the item).
        Returns:
        the thrower's name.
      • setThrower

        void setThrower​(java.lang.String name)
        Sets the thrower (entity that threw the item).
        Parameters:
        name - the thrower's name.
      • getPickupDelay

        int getPickupDelay()
        Returns:
        Ticks remaining before the item can be picked up. (32767 indicates an infinite delay.)
      • setPickupDelay

        void setPickupDelay​(int delay)
        Sets the delay before the item can be picked up.
        Parameters:
        delay - the pickup delay in ticks (32767 for infinite delay).
      • getAge

        long getAge()
        Specified by:
        getAge in interface IEntity<T extends net.minecraft.entity.item.EntityItem>
        Returns:
        The age of the item in ticks.
      • setAge

        void setAge​(long age)
        Sets the age of the item.
        Parameters:
        age - the new age (−32767 indicates infinite age).
      • getLifeSpawn

        int getLifeSpawn()
        Returns:
        The lifespan threshold; when the age reaches this, the item despawns.
      • setLifeSpawn

        void setLifeSpawn​(int age)
        Sets the age threshold at which the item will despawn.
        Parameters:
        age - the lifespan in ticks.
      • getItem

        IItemStack getItem()
        Returns:
        The item contained in this entity.
      • setItem

        void setItem​(IItemStack item)
        Sets the item contained in this entity.
        Parameters:
        item - the item to set.