My item already gives effect to the player when using the item, but I also need it to give a passive effect when someone holds the item in the offhand
I already tried to do this using /execute, but the constant player detection causes the hand animation to be buggy
event.create('hypesquad2:protection_rune', "basic")
.maxStackSize(1)
.glow(true)
.displayName('§2Runa da Proteção')
.useAnimation("bow")
.useDuration((itemstack) => 30)
.use((level, player, hand) => true)
.finishUsing((itemstack, level, entity) => {
let effects = entity.potionEffects;
effects.add("resistance", 10 * 20, 3)
entity.addItemCooldown('hypesquad2:protection_rune', 10000)
return itemstack
})```