#Add a tooltip to all items of a certain item class

12 messages · Page 1 of 1 (latest)

reef void
#

i want to create a item quality system where items stats change based on the item quality so i want to know if there's a way to display the items quality in a tooltip

merry lodgeBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

crystal basalt
reef void
#

Like a item that like "diamond sword (quality:poor)"

#

Nbt data basically

hollow oreBOT
#

[➤](#1382568300113821706 message)
try this

ItemEvents.tooltip(event => {
    event.addAdvanced('simplyswords:slumbering_lichblade', (item, advanced, text)=>{
        const killCount = item.nbt? (item.nbt.get('killCount') || 0) : 0
        text.add(
            Text.of(killCount)
            .append(Text.of('/50'))
        )
    })
});
reef void
#

How would I put that tooltip on all the items without manual adding each item though?

crystal basalt
#

you can use "*"

#

event.addAdvanced("*", ...)

reef void
#

Is there a way to exclude types of items like blocks

crystal basalt
#
    event.addAdvanced("*", (item, advanced, text) => {
        if(item.block) return;
        ...        
    })

reef void
#

Alright thank you