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 aMaterial
and aInteger
amountClickableItem(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.ItemStack
build()
returns theItemStack
that this class currently holdsonClick(GuiClickableItem clickableItemAction)
Sets the onClick action of thisClickableItem
Methods 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
TheGuiClickableItem
action for this class
-
-
Constructor Details
-
ClickableItem
public ClickableItem(org.bukkit.Material type, int amount)Creates a instnace of this class with aMaterial
and aInteger
amount- Parameters:
type
- AMaterial
to set for this itemamount
- AInteger
amount to set for this item
-
ClickableItem
Supports creating a lore with a material, amount, item name, and item lore- Parameters:
type
- AMaterial
amount
- AInteger
amount for thisItemStack
to haveitemName
- AString
name for this item to have, supports ampersand symbols for coloring TODO: Make this NullableitemLore
- AList
ofString
for the lore to have, supports ampersand symbols for coloring TODO: Make this Nullable
-
-
Method Details
-
onClick
Sets the onClick action of thisClickableItem
- Parameters:
clickableItemAction
- TheGuiClickableItem
action to set for this functional interface (Its a lambda function)- Returns:
- instance of this
ClickableItem
-
build
public org.bukkit.inventory.ItemStack build()returns theItemStack
that this class currently holds- Returns:
- A
ItemStack
-