#How do you check for item nbt when firing events?

6 messages · Page 1 of 1 (latest)

sinful hamlet
#

I am trying to make it so when a map is right clicked it only fires when it has a certain name.

hard swallowBOT
#

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

sinful hamlet
#

figured it out lol

scenic turretBOT
#

Please post how you solved your issue. Others may find this ticket later, but then have to create another because the actual solution wasn't mentioned. thanks <3

sinful hamlet
#

ItemEvents.rightClicked('minecraft:map', event => {
// event.server.scheduleInTicks(10, _ => {
const nbt = {display:{Name:'["",{"text":"Deep Dark Explorer Map","bold":true,"color":"blue"}]'}}

if (event.item.nbt == nbt){
    event.server.runCommandSilent(`say sex`)

    event.server.runCommandSilent(`execute as @p run item modify entity @s weapon.mainhand chocolate:city_map`)
    event.cancel()
}

})