#Check players item tag for held item

4 messages · Page 1 of 1 (latest)

solemn edge
#

How would I make it so I can use an item tag rather than an item id, attempting to simplify this so that any shield would work in this script. Tried doing this to no avail lol.

PlayerEvents.tick(event => {
    if (event.player.mainHandItem.id == 'simplyswords:runic_longsword' &&
        event.player.offHandItem.tag == 'forge:tools/shields'
    ) {
        event.player.potionEffects.add("irons_spellbooks:oakskin",120,1,false,false)
    };
});
late bronzeBOT
#

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

solemn edge
#

fixed by doing

(event.player.offHandItem.hasTag("forge:tools/shields"))
#

i silly ssDogSmile