I coded a custom irons spell sword, and I somehow got the animations of better combat working but the swings don't have hitboxes which means I can't hit entities. Any fix?
kube js:
// These all go in startup scripts
StartupEvents.registry("item", event => {
// Other item methods also work on these builders. It is recommended to give the spell books the proper Curios item tag for them to work properly.
// (that being "curios:spellbook")
// Also, you don't need to use a registry object for spells. You can input a string as the spell ID and it works just fine as well.
event.create("dustless", "irons_spells_js:magic_sword")
.displayName('§aDustless')
.attackDamageBaseline(14)
.speedBaseline(-1.5)
.addDefaultSpell("irons_spellbooks:divine_smite", 11)
.addDefaultSpell("irons_spellbooks:blood_step", 10)
})
file directory for better combat
kubejs/data/kubejs/weapon_attributes/swordId.json
swordId.json
{
"attributes": {
"range_bonus": 3,
"category": "rapier",
"attacks": [
{
"hitbox": "HORIZONTAL_PLANE",
"damage_multiplier": 0.9,
"angle": 90,
"upswing": 0.5,
"animation": "bettercombat:one_handed_slash_horizontal_left",
"swing_sound": {
"id": "bettercombat:rapier_slash"
}
},
{
"hitbox": "FORWARD_BOX",
"damage_multiplier": 1.1,
"angle": 0,
"upswing": 0.5,
"animation": "bettercombat:one_handed_stab",
"swing_sound": {
"id": "bettercombat:rapier_stab"
}
}
]
}
}