#Attachable Weapon attack animation

1 messages · Page 1 of 1 (latest)

blazing snow
#

Hello, i'm trying to add an attack animation to an item.
so how to detect attack / swing from the holder ?

here is my "code" for moment :

{
    "format_version": "1.10.0",
    "minecraft:attachable": {
        "description": {
            "identifier": "histeria:chocolate_staff",
            "render_controllers": ["controller.render.item_default"],
            "materials": {
                "default": "entity_alphatest",
                "enchanted": "entity_alphatest_glint"
            },
            "textures": {
                "default": "textures/entity/chocolate_staff",
                "enchanted": "textures/misc/enchanted_item_glint"
            },
            "geometry": {
                "default": "geometry.chocolate_staff"
            },
            "animations": {
                "first_person_hold": "animation.chocolate_staff.first_person_hold",
                "third_person_hold": "animation.chocolate_staff.third_person_hold",
                "first_person_attack": "animation.chocolate_staff.first_person_attack"
            },
            "scripts": {
                "animate": [
                    {
                        "first_person_hold": "c.is_first_person"
                    },
                    {
                        "third_person_hold": "!c.is_first_person"
                    },
                    {
                        "first_person_attack": "v.attack_time > 0.0"
                    }
                ]
            }
        }
    }
}
#

"v.attack_time..." doesn't work

cobalt nebula
#

no?

blazing snow
#

it should work ?

cobalt nebula
#

yes