Lets you parry (and block) melee attacks and projectiles with sword or axe. Shields can parry too.
In resources/assets/modid/models/item/ add a json file containing:
{
"parent": "modid:item/item_youre_adding_animation_for",
"display": {
"firstperson_righthand": {
"rotation": [ -40, -100, 25 ],
"translation": [ -3.13, 3.2, 1.13 ],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
Then, in your weapons model file, add one of these:
For swords:
"overrides": [
{
"predicate": {
"parry": 1
},
"model": "modid:item/name_of_file_youve_created"
}
]
For axes:
"overrides": [
{
"predicate": {
"axeparry": 1
},
"model": "modid:item/name_of_file_youve_created"
}
]
Your file should look like this (copper_sword.json from Frycmod):
{
"parent": "item/handheld",
"textures": {
"layer0": "frycmod:item/copper_sword"
},
"overrides": [
{
"predicate": {
"parry": 1
},
"model": "frycmod:item/copper_sword_parry"
}
]
}
That's all. Your weapon should now have the blocking animation.