Interface AdditionsItem


public interface AdditionsItem
Custom AdditionsPlus Item class. Allows the creation of custom items with left and right click actions and full customization.
  • Method Details

    • getName

      String getName()
      Get the identifier of this custom menu.
      Returns:
      Identifier of this menu.
    • getItemCostOnInteraction

      int getItemCostOnInteraction()
      Get the cost of this item interaction.
      Returns:
      Cost of the interaction.
    • setItemCostOnInteraction

      void setItemCostOnInteraction(int amount)
      Set the cost of this item interaction.
      Parameters:
      amount - Cost of the interaction.
    • getNotEnoughItemsMessage

      String getNotEnoughItemsMessage()
      Get the not enough items message.
      Returns:
      Not enough items message.
    • setNotEnoughItemsMessage

      void setNotEnoughItemsMessage(String message)
      Set the not enough items message.
      Parameters:
      message - Message to send.
    • setItemStack

      void setItemStack(org.bukkit.inventory.ItemStack itemStack)
      Set the cached item stack.
      Parameters:
      itemStack - ItemStack to cache.
    • getSlot

      int getSlot()
      Get the inventory slot of this item.
      Returns:
      Inventory slot of this item.
    • setSlot

      void setSlot(int slot)
      Set the inventory slot of this item.
      Parameters:
      slot - Slot of this item.
    • getCooldown

      long getCooldown()
      Get the cooldown in ticks.
      Returns:
      Cooldown in ticks.
    • setCooldown

      void setCooldown(long cooldown)
      Set the cooldown in ticks.
      Parameters:
      cooldown - Cooldown in ticks.
    • getCooldownMessage

      String getCooldownMessage()
      Get the on-cooldown message of this item.
      Returns:
      Cooldown message.
    • setCooldownMessage

      void setCooldownMessage(String cooldownMessage)
      Set the on-cooldown message of this item.
      Parameters:
      cooldownMessage - Message to send.
    • getPermission

      String getPermission()
      Get the required Bukkit permission of this item.
      Returns:
      Required Bukkit permission.
    • setPermission

      void setPermission(@Nullable String permission)
      Set the permission of this item.
      Parameters:
      permission - Bukkit permission.
    • getNoPermissionMessage

      String getNoPermissionMessage()
      Get the message that is sent to the player when they do not have permission for this item.
      Returns:
      No permission message to send.
    • setNoPermissionMessage

      void setNoPermissionMessage(String message)
      Set the message that is sent to the player when they do not have permission for this item.
      Parameters:
      message - Message to send.
    • getActions

      List<String> getActions()
      Get the non left-right click actions of this item.
      Returns:
      List of actions.
    • setActions

      void setActions(List<String> actions)
      Set the non left-right click actions of this item.
      Parameters:
      actions - List of actions.
    • getLeftClickActions

      List<String> getLeftClickActions()
      Get the left click actions of this item.
      Returns:
      List of actions.
    • setLeftClickActions

      void setLeftClickActions(List<String> actions)
      Set the left click actions of this item.
      Parameters:
      actions - List of actions.
    • getRightClickActions

      List<String> getRightClickActions()
      Get the right click actions of this item.
      Returns:
      List of actions.
    • setRightClickActions

      void setRightClickActions(List<String> actions)
      Set the right click actions of this item.
      Parameters:
      actions - List of actions.
    • getItemOptions

      List<ItemOption> getItemOptions()
      Get a List of ItemOption of this item.
      Returns:
      List of ItemOption.
    • setItemOptions

      void setItemOptions(List<ItemOption> options)
      Set a List of ItemOption.
      Parameters:
      options - List of ItemOption.
    • getDisplayName

      String getDisplayName()
      Get the display name of this item.
      Returns:
      Display name of this item.
    • setDisplayName

      void setDisplayName(String displayName)
      Set the display name of this item.
      Parameters:
      displayName - Display name of this item.
    • getMaterial

      String getMaterial()
      Get the material of this item.
      Returns:
      Material of this item.
    • setMaterial

      void setMaterial(String material)
      Set the material of this item.
      Parameters:
      material - Material of this item.
    • getData

      byte getData()

      Get the data of this item.
      This is used in legacy versions of Minecraft to differentiate different versions of an item (such as wool colors), but was later replaced with individual material names.

      Returns:
      Byte data.
    • setData

      void setData(byte data)

      Set the data of this item.
      This is used in legacy versions of Minecraft to differentiate different versions of an item (such as wool colors), but was later replaced with individual material names.

      Parameters:
      data - Byte data.
    • getAmount

      int getAmount()
      Get the item amount.
      Returns:
      Amount of items.
    • setAmount

      void setAmount(int amount)
      Set the item amount.
      Parameters:
      amount - Amount of items.
    • getDurability

      short getDurability()
      Get the durability of this item. Durability is the number of useful actions an item can perform which depletes on item use.
      Returns:
      Short durability.
    • setDurability

      void setDurability(short durability)
      Set the durability of this item. Durability is the number of useful actions an item can perform which depletes on item use.
      Parameters:
      durability - Short durability.
    • getLore

      List<String> getLore()
      Get the lore of this item.
      Returns:
      List of lore lines.
    • setLore

      void setLore(List<String> lore)
      Set the lore of this item.
      Parameters:
      lore - List of lore lines.
    • getItemFlags

      List<org.bukkit.inventory.ItemFlag> getItemFlags()
      Get the item flags of this item.
      Returns:
      List of ItemFlag.
    • setItemFlags

      void setItemFlags(List<org.bukkit.inventory.ItemFlag> flags)
      Set the item flags of this item.
      Parameters:
      flags - List of ItemFlag.
    • getEnchantments

      HashMap<org.bukkit.enchantments.Enchantment,Integer> getEnchantments()
      Get a list of the enchantments and their strengths.
      Returns:
      HashMap of Enchantment and their strength
    • setEnchantments

      void setEnchantments(HashMap<org.bukkit.enchantments.Enchantment,Integer> enchantments)
      Set the enchantments of this item.
      Parameters:
      enchantments - HashMap of Enchantment and their strength.
    • isUnbreakable

      boolean isUnbreakable()
      Get whether this item should be unbreakable.
      Returns:
      True when enabled, false otherwise.
    • setUnbreakable

      void setUnbreakable(boolean unbreakable)
      Set whether this item should be unbreakable.
      Parameters:
      unbreakable - Unbreakable.
    • getCustomModelData

      int getCustomModelData()
      Get the custom model data of this item. This is often used in texture packs.
      Returns:
      Custom model data.
    • setCustomModelData

      void setCustomModelData(int customModelData)
      Set the custom model data of this item. This is often used in texture packs.
      Parameters:
      customModelData - Custom model data.
    • getArmorColor

      String getArmorColor()
      Get the HEX armor color.
      Returns:
      HEX armor color.
    • setArmorColor

      void setArmorColor(String color)
      Set the armor color of this item.
      Parameters:
      color - HEX armor color.
    • determineMaterial

      org.bukkit.inventory.ItemStack determineMaterial(org.bukkit.entity.Player player)
      Determine the base material of this item based on the player in case of any placeholder usage.
      Parameters:
      player - Placeholder owner.
      Returns:
      Base ItemStack.
    • giveItem

      org.bukkit.inventory.ItemStack giveItem(org.bukkit.entity.Player player, boolean give)
      Give this custom item to a player.
      Parameters:
      player - Player to apply data to.
      give - Whether to add it to their inventory.
      Returns:
      ItemStack with the player's data applied to this item.
    • isExtendedPotion

      boolean isExtendedPotion()
      Get whether this potion is extended.
      Returns:
      True if enabled, false otherwise.
    • setExtendedPotion

      void setExtendedPotion(boolean extendedPotion)
      Set whether this potion is extended.
      Parameters:
      extendedPotion - Extended potion.
    • isUpgradedPotion

      boolean isUpgradedPotion()
      Get whether this potion is upgraded.
      Returns:
      True if enabled, false otherwise.
    • setUpgradedPotion

      void setUpgradedPotion(boolean upgradedPotion)
      Set whether this potion is upgraded.
      Parameters:
      upgradedPotion - Upgraded potion.
    • getPotionColor

      String getPotionColor()
      Get the potion color in HEX.
      Returns:
      HEX potion color when found, null otherwise.
    • setPotionColor

      void setPotionColor(String color)
      Set the potion color in HEX.
      Parameters:
      color - HEX potion color.
    • getPotionType

      String getPotionType()
      Get the potion type.
      Returns:
      Type of potion when found, null otherwise.
    • setPotionType

      void setPotionType(String type)
      Set the type of potion.
      Parameters:
      type - Potion type.