Package dev.selena.luacore.utils.items
Class ItemUtils
java.lang.Object
dev.selena.luacore.utils.items.ItemUtils
Useful item utility class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.ItemStackdeleteItem(org.bukkit.inventory.ItemStack item, int amount) Used for removing x items from a player inventory or some form of stackstatic booleanisArmor(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is armorstatic booleanisAxe(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is an axestatic booleanisBoots(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is bootsstatic booleanisBow(org.bukkit.inventory.ItemStack item) Checks if the ItemStack in question is a bowstatic booleanisChestplate(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is a chestplatestatic booleanisCrossBow(org.bukkit.inventory.ItemStack item) Checks if the ItemStack in question is a cross bowstatic booleanisHelmet(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is a helmetstatic booleanisHoe(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is a hoestatic booleanisLeather(org.bukkit.inventory.ItemStack item) Used for checking if an item is leather for dyingstatic booleanisLeggings(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is leggingsstatic booleanisPickaxe(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is a pickaxestatic booleanisShovel(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is a shovelstatic booleanisSword(org.bukkit.inventory.ItemStack item) Checks if the ItemStack in question is a swordstatic booleanisTool(org.bukkit.inventory.ItemStack item) Checks if the ItemStack is a toolstatic booleanisWeapon(org.bukkit.inventory.ItemStack item) Used for seeing if an ItemStack is a weapon
-
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 fromamount- 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
-