Class NbtUtils

java.lang.Object
me.yleoft.zAPI.utils.NbtUtils
Direct Known Subclasses:
ItemListeners

public abstract class NbtUtils extends Object
NbtUtils class to handle NBT operations on items.
  • Constructor Details

    • NbtUtils

      public NbtUtils()
  • Method Details

    • markItem

      public static void markItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String mark)
      Marks an item with a specific mark.
      Parameters:
      item - The item to mark.
      mark - The mark to apply to the item.
    • unmarkItem

      public static void unmarkItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String mark)
      Unmarks an item with a specific mark.
      Parameters:
      item - The item to unmark.
      mark - The mark to remove from the item.
    • isMarked

      public static boolean isMarked(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String mark)
      Checks if an item is marked with a specific mark.
      Parameters:
      item - The item to check.
      mark - The mark to check for.
      Returns:
      True if the item is marked, false otherwise.
    • addCustomCommand

      public static void addCustomCommand(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String command, @Nullable @Nullable HashMap<String,String> replaces, boolean isConsole)
      Adds a custom command NBT to an item.
      Parameters:
      item - The item to add the command to.
      command - The command to add.
    • addCustomCommands

      public static void addCustomCommands(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull List<String> commands, @Nullable @Nullable HashMap<String,String> replaces, boolean isConsole)
    • addCustomCommands

      public static void addCustomCommands(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull List<String> commands, boolean isConsole)
    • addCustomCommands

      public static void addCustomCommands(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull List<String> commands)
    • addCustomCommands

      public static void addCustomCommands(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull List<String> commands, @Nullable @Nullable HashMap<String,String> replaces)
    • addCustomCommand

      public static void addCustomCommand(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String command, @Nullable @Nullable HashMap<String,String> replaces)
    • addCustomCommand

      public static void addCustomCommand(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String command)
    • removeCustomCommand

      public static void removeCustomCommand(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String command)
      Removes a custom command NBT from an item.
      Parameters:
      item - The item to remove the command from.
      command - The command to remove.
    • getCustomCommands

      public static List<String> getCustomCommands(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Gets the custom commands from an item.
      Parameters:
      item - The item to get the commands from.
      Returns:
      A list of custom commands.