#Give a effect for a player that is holding the item in offhand

4 messages · Page 1 of 1 (latest)

dusk gale
#

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
})```
somber driftBOT
#

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

somber driftBOT
#

@dusk gale Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!

somber driftBOT
#

@dusk gale Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!