Class ItemNBT

java.lang.Object
org.kingdoms.utils.nbt.ItemNBT

public final class ItemNBT extends Object
  • Field Details

    • CAN_ACCESS_UNBREAKABLE

      public static final boolean CAN_ACCESS_UNBREAKABLE
  • Method Details

    • setTag

      public static org.bukkit.inventory.ItemStack setTag(org.bukkit.inventory.ItemStack item, NBTWrappers.NBTTagCompound tag)
      Sets the NBT tag of an item
      Parameters:
      tag - The new tag
      item - The ItemStack
      Returns:
      The modified itemStack
    • getTag

      public static NBTWrappers.NBTTagCompound getTag(org.bukkit.inventory.ItemStack item)
      Gets the NBTTag of an item. In case of any error it returns a blank one.
      Parameters:
      item - The ItemStack to get the tag for
      Returns:
      The NBTTagCompound of the ItemStack or a new one if it had none or an error occurred
    • addSimpleTag

      public static org.bukkit.inventory.ItemStack addSimpleTag(org.bukkit.inventory.ItemStack item, String tag, String value)
    • setUnbreakable

      public static org.bukkit.inventory.ItemStack setUnbreakable(org.bukkit.inventory.ItemStack item, boolean unbreakable)
    • setCanPlaceOnAndDestroy

      public static void setCanPlaceOnAndDestroy(NBTWrappers.NBTTagCompound tag, Collection<com.cryptomorin.xseries.XMaterial> canPlaceOn, Collection<com.cryptomorin.xseries.XMaterial> canDestroy)
      https://minecraft.fandom.com/wiki/Player.dat_format#General_Tags Doesn't support the full minecraft:block_predicate format.
    • isKingdomsItem

      public static boolean isKingdomsItem(org.bukkit.inventory.ItemStack item)