Package com.burchard36.api.inventory
Class ClickableItem
java.lang.Object
com.burchard36.api.utils.ItemWrapper
com.burchard36.api.inventory.ClickableItem
A clickable item the executes methods on a
PluginInventory's InventoryClickEvent
if, you have the functional interface method set of course-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClickableItem(org.bukkit.Material type, int amount)Creates a instnace of this class with aMaterialand aIntegeramountClickableItem(org.bukkit.Material type, int amount, String itemName, List<String> itemLore)Supports creating a lore with a material, amount, item name, and item lore -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStackbuild()returns theItemStackthat this class currently holdsonClick(GuiClickableItem clickableItemAction)Sets the onClick action of thisClickableItemMethods inherited from class com.burchard36.api.utils.ItemWrapper
addDataInteger, addDataString, addEnchantment, addEnchantments, addItemLore, getDisplayName, getIntegerDataValue, getItemStack, getLore, getStringDataValue, hasDataInteger, hasDataString, setDisplayName, setItemLore, setModelData, setSkullTo
-
Field Details
-
guiClickableItem
TheGuiClickableItemaction for this class
-
-
Constructor Details
-
ClickableItem
public ClickableItem(org.bukkit.Material type, int amount)Creates a instnace of this class with aMaterialand aIntegeramount- Parameters:
type- AMaterialto set for this itemamount- AIntegeramount to set for this item
-
ClickableItem
Supports creating a lore with a material, amount, item name, and item lore- Parameters:
type- AMaterialamount- AIntegeramount for thisItemStackto haveitemName- AStringname for this item to have, supports ampersand symbols for coloring TODO: Make this NullableitemLore- AListofStringfor the lore to have, supports ampersand symbols for coloring TODO: Make this Nullable
-
-
Method Details
-
onClick
Sets the onClick action of thisClickableItem- Parameters:
clickableItemAction- TheGuiClickableItemaction to set for this functional interface (Its a lambda function)- Returns:
- instance of this
ClickableItem
-
build
public org.bukkit.inventory.ItemStack build()returns theItemStackthat this class currently holds- Returns:
- A
ItemStack
-