Interface IItemStack

  • All Known Subinterfaces:
    IItemCustom

    public interface IItemStack
    • Method Detail

      • getName

        java.lang.String getName()
      • getStackSize

        int getStackSize()
        Returns:
        Returns the stacksize
      • hasCustomName

        boolean hasCustomName()
        Returns:
        Return whether the item has a custom name
      • setCustomName

        void setCustomName​(java.lang.String name)
        Parameters:
        name - The custom name this item will get
      • getDisplayName

        java.lang.String getDisplayName()
        Returns:
        Return the ingame displayed name. This is either the item name or the custom name if it has one.
      • getItemName

        java.lang.String getItemName()
        Returns:
        Get the items ingame name. Use this incase the item ingame has custom name and you want the original name.
      • setStackSize

        void setStackSize​(int size)
        Parameters:
        size - The size of the itemstack. A number between 1 and 64
      • getMaxStackSize

        int getMaxStackSize()
      • getItemDamage

        int getItemDamage()
        Returns:
        Returns the item damage of this item. For tools this is the durability for other items the color and more.
      • setItemDamage

        void setItemDamage​(int value)
        Parameters:
        value - The value to be set as item damage. For tools this is the durability for other items the color and more.
      • setTag

        void setTag​(java.lang.String key,
                    java.lang.Object value)
        Parameters:
        key - The key of this NBTTag
        value - The value to be stored. Can be a Number or String
      • hasTag

        boolean hasTag​(java.lang.String key)
        Parameters:
        key - The key of the NBTTag
        Returns:
        Returns whether or not the key exists
      • getTag

        java.lang.Object getTag​(java.lang.String key)
        Parameters:
        key - The key of the NBTTag
        Returns:
        Returns the value associated with the key. Returns null of it doesnt exist
      • removeTags

        INbt removeTags()
      • isEnchanted

        boolean isEnchanted()
      • hasEnchant

        boolean hasEnchant​(int id)
        Parameters:
        id - The enchantment id
        Returns:
        Since:
        1.7.10d
      • addEnchant

        void addEnchant​(int id,
                        int strength)
      • setAttribute

        void setAttribute​(java.lang.String name,
                          double value)
      • getAttribute

        double getAttribute​(java.lang.String name)
      • getLore

        java.lang.String[] getLore()
      • hasLore

        boolean hasLore()
      • setLore

        void setLore​(java.lang.String[] lore)
      • hasAttribute

        boolean hasAttribute​(java.lang.String name)
      • isWrittenBook

        boolean isWrittenBook()
        Returns:
        Returns whether this item is a book
        Since:
        1.7.10d
      • getBookTitle

        java.lang.String getBookTitle()
        Returns:
        Returns the books title
        Since:
        1.7.10d
      • getBookAuthor

        java.lang.String getBookAuthor()
        Returns:
        Returns the books author
        Since:
        1.7.10d
      • getBookText

        java.lang.String[] getBookText()
        Returns:
        If the item is a book, returns a string array with book pages
        Since:
        1.7.10d
      • isBlock

        boolean isBlock()
        Returns:
        Returns whether or not this item is a block
      • getNbt

        INbt getNbt()
      • getItemNbt

        INbt getItemNbt()
      • getMCItemStack

        net.minecraft.item.ItemStack getMCItemStack()
        No support is given for this method. Dont use if you dont know what you are doing.
        Returns:
        Minecraft ItemStack
      • itemHash

        int itemHash()
      • getMCNbt

        net.minecraft.nbt.NBTTagCompound getMCNbt()
      • setMCNbt

        void setMCNbt​(net.minecraft.nbt.NBTTagCompound compound)