Difference between ItemStack.weakNBT() and ItemStack.strongNBT()
OriginalNovember 10, 2024Less than 1 minute
Difference between ItemStack.weakNBT()
and ItemStack.strongNBT()
Using Item.of("diamond_sword", "{damage:50}")
as an example:
.weakNBT()
If the item's NBT contains{damage:50}
, it can be used. Examples:- ✅
{damage:50}
- ✅
{damage:50, display:"Sword"}
- ❌
{display:"Sword"}
- ✅
.strongNBT()
If the item's NBT only contains"{damage:50}"
, it can be used. Examples:- ✅
{damage:50}
- ❌
{damage:50, display:"Sword"}
- ❌
{display:"Sword"}
- ✅