I'm trying to run a command whenever I use a specific gate pearl from Gateways to Eternity. The item works by having you right click the ground with it, so I don't think ItemEvents.rightClicked is working. In any case, here's my code at the moment.
ItemEvents.rightClicked('gateways:gate_pearl', event => {
const nbt = {gateway:"gateways:test_gateway"}
if (event.item.nbt==nbt){
event.server.runCommand('say Hello!');
}
}
)