Interface NBTWrapper
public interface NBTWrapper
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringGets the NBT tag based on a given key.org.bukkit.inventory.ItemStackRemoves a tag from anItemStack.org.bukkit.inventory.ItemStacksetBoolean(@NotNull org.bukkit.inventory.ItemStack itemStack, String key, boolean value) Sets a boolean to theItemStack.org.bukkit.inventory.ItemStackSets an String NBT tag to the anItemStack.
-
Method Details
-
setString
org.bukkit.inventory.ItemStack setString(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, String key, String value) Sets an String NBT tag to the anItemStack.- Parameters:
itemStack- The currentItemStackto be set.key- The NBT key to use.value- The tag value to set.- Returns:
- An
ItemStackthat has NBT set.
-
removeTag
org.bukkit.inventory.ItemStack removeTag(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, String key) Removes a tag from anItemStack.- Parameters:
itemStack- The currentItemStackto be remove.key- The NBT key to remove.- Returns:
- An
ItemStackthat has the tag removed.
-
setBoolean
org.bukkit.inventory.ItemStack setBoolean(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, String key, boolean value) Sets a boolean to theItemStack. Mainly used for setting an item to be unbreakable on older versions.- Parameters:
itemStack- TheItemStackto set the boolean to.key- The key to use.value- The boolean value.- Returns:
- An
ItemStackwith a boolean value set.
-
getString
@Nullable @Nullable String getString(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, String key) Gets the NBT tag based on a given key.- Parameters:
itemStack- TheItemStackto get from.key- The key to look for.- Returns:
- The tag that was stored in the
ItemStack.
-