Package org.kingdoms.utils.nbt
Class ItemNBT
java.lang.Object
org.kingdoms.utils.nbt.ItemNBT
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.ItemStackaddSimpleTag(org.bukkit.inventory.ItemStack item, String tag, String value) static NBTWrappers.NBTTagCompoundgetTag(org.bukkit.inventory.ItemStack item) Gets the NBTTag of an item.static booleanisKingdomsItem(org.bukkit.inventory.ItemStack item) static voidsetCanPlaceOnAndDestroy(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.static org.bukkit.inventory.ItemStacksetTag(org.bukkit.inventory.ItemStack item, NBTWrappers.NBTTagCompound tag) Sets the NBT tag of an itemstatic org.bukkit.inventory.ItemStacksetUnbreakable(org.bukkit.inventory.ItemStack item, boolean unbreakable)
-
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 tagitem- The ItemStack- Returns:
- The modified itemStack
-
getTag
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
-
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)
-