#Apply an effect when a player holds any item with a specific NBT tag

4 messages · Page 1 of 1 (latest)

finite scroll
#

I apologize ahead of time for being terrible at this. I'm trying to apply a potion effect whenever a player holdss any sword. I've seen some examples of how to do this with a specific item. Is there some way to do this with all of items of a type? Thanks for any help you can provide.

blazing sequoiaBOT
#

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

sweet willow
#
ItemEvents.rightClicked(e => {
    e.item.nbt.test = 1
    if(e.item.nbt.test) {
        e.player.potionEffects.add('speed', 40, 0)
    }
})
finite scroll
#

@sweet willow Thank you!