Tooltip addition doesn't take item nbt into account
Yarden-zamir opened this issue ยท 2 comments
I can't tell if this is a bug or intentional, however:
Using addAdvanced, you can check item NBT within the handler.
Ex using an arrow. If you enchant the arrow in creative, the tooltip will change.
onEvent('item.tooltip', event=> {
event.addAdvanced(Item.of('minecraft:arrow'), (s, adv, text) => {
if(s.hasNBT()){ // Check if the item has NBT
// Add further logic here if you'd like.
text.add("This item has NBT Data!");
}else{
text.add("This item has no NBT Data!");
}
})
})