Package me.yleoft.zAPI.utils
Class NbtUtils
java.lang.Object
me.yleoft.zAPI.utils.NbtUtils
- Direct Known Subclasses:
ItemListeners
NbtUtils class to handle NBT operations on items.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCustomCommand(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String command) static voidaddCustomCommand(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String command, @Nullable HashMap<String, String> replaces) static voidaddCustomCommand(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String command, @Nullable HashMap<String, String> replaces, boolean isConsole) Adds a custom command NBT to an item.static voidaddCustomCommands(@NotNull org.bukkit.inventory.ItemStack item, @NotNull List<String> commands) static voidaddCustomCommands(@NotNull org.bukkit.inventory.ItemStack item, @NotNull List<String> commands, boolean isConsole) static voidaddCustomCommands(@NotNull org.bukkit.inventory.ItemStack item, @NotNull List<String> commands, @Nullable HashMap<String, String> replaces) static voidaddCustomCommands(@NotNull org.bukkit.inventory.ItemStack item, @NotNull List<String> commands, @Nullable HashMap<String, String> replaces, boolean isConsole) getCustomCommands(@NotNull org.bukkit.inventory.ItemStack item) Gets the custom commands from an item.static booleanChecks if an item is marked with a specific mark.static voidMarks an item with a specific mark.static voidremoveCustomCommand(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String command) Removes a custom command NBT from an item.static voidunmarkItem(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String mark) Unmarks an item with a specific mark.
-
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
-
addCustomCommands
-
addCustomCommands
-
addCustomCommands
-
addCustomCommand
-
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
Gets the custom commands from an item.- Parameters:
item- The item to get the commands from.- Returns:
- A list of custom commands.
-