Class ItemUtils

java.lang.Object
dev.selena.luacore.utils.items.ItemUtils

public class ItemUtils extends Object
Useful item utility class
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.inventory.ItemStack
    deleteItem(org.bukkit.inventory.ItemStack item, int amount)
    Used for removing x items from a player inventory or some form of stack
    static boolean
    isArmor(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is armor
    static boolean
    isAxe(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is an axe
    static boolean
    isBoots(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is boots
    static boolean
    isBow(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack in question is a bow
    static boolean
    isChestplate(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is a chestplate
    static boolean
    isCrossBow(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack in question is a cross bow
    static boolean
    isHelmet(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is a helmet
    static boolean
    isHoe(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is a hoe
    static boolean
    isLeather(org.bukkit.inventory.ItemStack item)
    Used for checking if an item is leather for dying
    static boolean
    isLeggings(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is leggings
    static boolean
    isPickaxe(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is a pickaxe
    static boolean
    isShovel(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is a shovel
    static boolean
    isSword(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack in question is a sword
    static boolean
    isTool(org.bukkit.inventory.ItemStack item)
    Checks if the ItemStack is a tool
    static boolean
    isWeapon(org.bukkit.inventory.ItemStack item)
    Used for seeing if an ItemStack is a weapon

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ItemUtils

      public ItemUtils()
  • Method Details

    • isWeapon

      public static boolean isWeapon(org.bukkit.inventory.ItemStack item)
      Used for seeing if an ItemStack is a weapon
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a sword or axe
      See Also:
    • isSword

      public static boolean isSword(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack in question is a sword
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a sword
    • isAxe

      public static boolean isAxe(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is an axe
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is an axe
    • isBow

      public static boolean isBow(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack in question is a bow
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a bow
    • isCrossBow

      public static boolean isCrossBow(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack in question is a cross bow
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a cross bow
    • isArmor

      public static boolean isArmor(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is armor
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a helmet, chestplate, leggings, or boots
      See Also:
    • isHelmet

      public static boolean isHelmet(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is a helmet
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a helmet
    • isChestplate

      public static boolean isChestplate(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is a chestplate
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a chestplate
    • isLeggings

      public static boolean isLeggings(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is leggings
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is leggings
    • isBoots

      public static boolean isBoots(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is boots
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is boots
    • isLeather

      public static boolean isLeather(org.bukkit.inventory.ItemStack item)
      Used for checking if an item is leather for dying
      Parameters:
      item - The item you want to check
      Returns:
      True if leather armor or horse armor
    • isTool

      public static boolean isTool(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is a tool
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is an Axe, Pickaxe, Shovel, or Hoe
      See Also:
    • isPickaxe

      public static boolean isPickaxe(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is a pickaxe
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a pickaxe
    • isShovel

      public static boolean isShovel(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is a shovel
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a shovel
    • isHoe

      public static boolean isHoe(org.bukkit.inventory.ItemStack item)
      Checks if the ItemStack is a hoe
      Parameters:
      item - The itemStack you want to check
      Returns:
      True if the item is a hoe
    • deleteItem

      public static org.bukkit.inventory.ItemStack deleteItem(org.bukkit.inventory.ItemStack item, int amount)
      Used for removing x items from a player inventory or some form of stack
      Parameters:
      item - The item you want to remove from
      amount - The number of items you want to remove
      Returns:
      if the value is less than or equal to 0, it will return an Air ItemStack