onEvent('block.right_click', event => {
const player = event.player
const item = player.mainHandItem
if (player.level.isClientSide) return
if (!item || item.id != 'kubejs:warrior_shield') return
if (player.isCrouching()) {
player.tell("🧎 Detected crouching (via isCrouching())")
} else {
player.tell("🚶 Not crouching (via isCrouching())")
}
})
onEvent('player.tick', event => {
const player = event.player
const heldItem = player.mainHandItem
if (heldItem.id == 'kubejs:warrior_shield') {
player.potionEffects.add('minecraft:resistance', 40, 0, false, false)
}
})
this is everything i currently have working.
the goal from here is to create;
Target enemies directly (damage, control)
Target allies directly
(Healing, buffs)
Create a deployable
(Aoe heal, damage, control)
Have a skill shot
(Fireball ish, splash potion of healing ish)
Have a beam from a player
(Healing, damage)
oh and MAYBE summons (maybe using abilities that exist from other mods?)
Any examples that would help figure out any of these would be awesome thank u 🙂