Class SerializedItemStackJsonNbt
java.lang.Object
sawfowl.localeapi.api.serializetools.itemstack.SerializedItemStackJsonNbt
- All Implemented Interfaces:
CompoundTag
The class is intended for working with item data when it is necessary to access it before registering item data in the registry.
-
Constructor Summary
ConstructorsConstructorDescriptionSerializedItemStackJsonNbt(String type, int quantity, com.google.gson.JsonObject nbt) SerializedItemStackJsonNbt(ItemStack itemStack) -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.key.KeyThe resulting value can be used to display the item in chat.GettingItemStackGettingItemTypecom.google.gson.JsonObjectgetNBT()The method returns a copy of the item's NBT tag collection in Json format.Gaining access to the NBT tags of an item.voidsetQuantity(int quantity) ChangingItemStackvolume.com.google.gson.JsonObjectConvert class objects to json data array.
It is recommended not to do `return null`.toString()
-
Constructor Details
-
SerializedItemStackJsonNbt
-
SerializedItemStackJsonNbt
-
SerializedItemStackJsonNbt
-
SerializedItemStackJsonNbt
-
-
Method Details
-
getItemStack
GettingItemStack -
getItemType
GettingItemType -
getItemTypeAsString
-
getNBT
public com.google.gson.JsonObject getNBT()The method returns a copy of the item's NBT tag collection in Json format. -
getQuantity
-
getItemKey
public net.kyori.adventure.key.Key getItemKey()The resulting value can be used to display the item in chat. -
setQuantity
public void setQuantity(int quantity) ChangingItemStackvolume. -
getOrCreateTag
Gaining access to the NBT tags of an item. -
toSerializedItemStackPlainNBT
-
toJsonObject
public com.google.gson.JsonObject toJsonObject()Description copied from interface:CompoundTagConvert class objects to json data array.
It is recommended not to do `return null`.- Specified by:
toJsonObjectin interfaceCompoundTag
-
toString
-