Class Item

  • Direct Known Subclasses:
    ActionItem

    public class Item
    extends java.lang.Object
    This class represent an item in the GUI This item is not reactive to click event if you want to execute something when clicking on an item use ActionItem instead
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull Item amount​(int amount)
      Set the amount of this item
      static @NotNull Item create​(@NotNull org.bukkit.inventory.ItemStack stack)
      Create a new Item instance
      static @NotNull Item create​(@NotNull org.bukkit.Material material)
      Create a new Item instance
      @NotNull Item flag​(@NotNull org.bukkit.inventory.ItemFlag... flags)
      Set the flags of this item
      @NotNull Item lore​(@NotNull java.lang.String... lore)
      Set the lore of this item
      @NotNull Item material​(@NotNull org.bukkit.Material material)
      Set the material used by this item
      @NotNull Item name​(@NotNull java.lang.String name)
      Set the name of this item
      @NotNull Item stack​(@NotNull org.bukkit.inventory.ItemStack stack)
      Set the ItemStack of this item
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        @NotNull
        public static @NotNull Item create​(@NotNull
                                           @NotNull org.bukkit.Material material)
        Create a new Item instance
        Parameters:
        material - Material of this item
        Returns:
        Instance created
      • create

        @NotNull
        public static @NotNull Item create​(@NotNull
                                           @NotNull org.bukkit.inventory.ItemStack stack)
        Create a new Item instance
        Parameters:
        stack - ItemStack of this item
        Returns:
        Instance created
      • material

        @NotNull
        public @NotNull Item material​(@NotNull
                                      @NotNull org.bukkit.Material material)
        Set the material used by this item
        Parameters:
        material - Material of this item
        Returns:
        Current instance
      • amount

        @NotNull
        public @NotNull Item amount​(int amount)
        Set the amount of this item
        Parameters:
        amount - Amount of the item
        Returns:
        Current instance
      • name

        @NotNull
        public @NotNull Item name​(@NotNull
                                  @NotNull java.lang.String name)
        Set the name of this item
        Parameters:
        name - Name of this item
        Returns:
        Current instance
      • lore

        @NotNull
        public @NotNull Item lore​(@NotNull
                                  @NotNull java.lang.String... lore)
        Set the lore of this item
        Parameters:
        lore - Lore of this item
        Returns:
        Current instance
      • flag

        @NotNull
        public @NotNull Item flag​(@NotNull
                                  @NotNull org.bukkit.inventory.ItemFlag... flags)
        Set the flags of this item
        Parameters:
        flags - Flags to add
        Returns:
        Current instance
      • stack

        @NotNull
        public @NotNull Item stack​(@NotNull
                                   @NotNull org.bukkit.inventory.ItemStack stack)
        Set the ItemStack of this item
        Parameters:
        stack - ItemStack of this item
        Returns:
        Current instance