Enum Class NBTUtil

java.lang.Object
java.lang.Enum<NBTUtil>
dk.lockfuglsang.minecraft.nbt.NBTUtil
All Implemented Interfaces:
Serializable, Comparable<NBTUtil>, Constable

public enum NBTUtil extends Enum<NBTUtil>
Utility for setting NBTTag data on Bukkit items without NMS (using reflection).
Since:
1.7
  • Method Details

    • values

      public static NBTUtil[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NBTUtil valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getNBTTag

      public static String getNBTTag(org.bukkit.inventory.ItemStack itemStack)
      Returns the NBTTag of the itemStack as a string, or the empty-string if none was found.
      Parameters:
      itemStack - A Bukkit ItemStack
      Returns:
      the NBTTag
      Since:
      1.7
    • setNBTTag

      public static org.bukkit.inventory.ItemStack setNBTTag(org.bukkit.inventory.ItemStack itemStack, String nbtTagString)
      Returns a copy of the itemStack with the supplied nbtTagString applied.
      Parameters:
      itemStack - A Bukkit ItemStack
      nbtTagString - A valid NBTTag string
      Returns:
      a copy of the itemStack
      Since:
      1.7
    • addNBTTag

      public static org.bukkit.inventory.ItemStack addNBTTag(org.bukkit.inventory.ItemStack itemStack, String nbtTagString)
      Returns a copy of the itemStack with the supplied nbtTagString applied.
      Parameters:
      itemStack - A Bukkit ItemStack
      nbtTagString - A valid NBTTag string
      Returns:
      a copy of the itemStack
      Since:
      1.7
    • setNBTItemStackTagger

      public static void setNBTItemStackTagger(NBTItemStackTagger tagger)