#Animation controller Death Commands

76 messages ยท Page 1 of 1 (latest)

sacred wing
#
        "controller.animation.blox.death": {
            "initial_state": "default",
            "states": {
                "default": {
                    "transitions": [{
                        "death": "!query.is_alive"
                    }]
                },
                "death": {
                    "run_command": {
                        "command": ["summon c:blox_death"]
                    }
                }
            }
        }

It said run command shouldn't be there,am i doing right
I was tryna summon an entity using command when this entity died

thorny maple
#

Animation Controllers don't use run_command, it uses the on_entry object followed directly by an array of commands:

#
{
    "format_version": "1.19.10",
    "animation_controllers": {
        "controller.animation.die": {
            "initial_state": "default",
            "states": {
                "default": {
                    "transitions": [
                        {
                            "death": "!q.is_alive"
                        }
                    ]
                },
                "death": {
                    "on_entry": [
                        "/summon pig ~~~"
                    ]
                }
            }
        }
    }
}
#

like so

#

unlike the newer files for entities and items, you do also require a "/" prior to animation controller commands

sacred wing
#

Ohh

#

Thank you

#

Does it can put multiple commands

#

@thorny maple

#

like ["/..", "/.."]

#

Nvm ill try

thorny maple
#

You can do multiple, just separate by commas ๐Ÿ‘

sacred wing
thorny maple
#

Did you assign the animation controller with animations and scripts in the entity description?

sacred wing
#

Oh in scripts,not yet

{
    "format_version": "1.10.0",
    "animation_controllers": {
        "controller.animation.blox.walk": {
            "initial_state": "standing",
            "states": {
                "standing": {
                    "blend_transition": 0.2,
                    "animations": ["idle"],
                    "transitions": [
                        {
                            "moving": "query.ground_speed > 0.1"
                        }
                    ]
                },
                "moving": {
                    "blend_transition": 0.2,
                    "animations": ["move"],
                    "transitions": [
                        {
                            "standing": "query.ground_speed < 0.1"
                        }
                    ]
                }
            }
        },
        "controller.animation.blox.death": {
            "initial_state": "default",
            "states": {
                "default": {
                    "transitions": [{
                        "death": "!query.is_alive"
                    }]
                },
                "death": {
                    "on_entry": ["/summon c:blox_death ~~~", "/effect @s invisibility"]
                }
            }
        }
    }
}
#

Still doesn't work

thorny maple
#

Let me check something

sacred wing
#
{
    "format_version": "1.19.0",
    "minecraft:client_entity": {
        "description": {
            "identifier": "c:blox",
            "materials": {
                "default": "entity_alphatest"
            },
            "textures": {
                "default": "textures/entity/blox_alive"
            },
            "geometry": {
                "default": "geometry.blox"
            },
            "scripts": {
                "animate": ["walk_controller", "death_controller"]
            },
        "animations": {
                "walk_controller": "controller.animation.blox.walk",
                "death_controller": "controller.animation.blox.death",
                "idle": "animation.blox.idle",
                "move": "animation.blox.move"
        },
        "spawn_egg": {
                "overlay_color": "#363434",
                "base_color": "#fffcfc"
        },
                    "render_controllers": ["controller.render.blox"]
        }
    }
}
#

Client

thorny maple
#

well in regards to what you wanna do, you don't want to use the client side entity, because that's only for the looks of the game. What you want are the animations_controllers in the behaviors since that's the only way you'll get commands to register.

#
    "description": {
        "identifier": "minecraft:pig",
        "is_spawnable": true,
        "is_summonable": true,
        "is_experimental": false,
        "animations": {
            "death": "controller.animation.die"
        },
        "scripts": {
            "animate": [
                {
                    "death": "!q.is_alive"
                }
            ]
        }
    }
}
#

this is the description for a pig in the behavior pack, I paired it with the animation controller I had and it works ok

sacred wing
#

What about the walk controller

#

I put two controllers

thorny maple
#

oh I see, they need to be separated. One is client, one is behavior

sacred wing
#

Ohh

thorny maple
#

the walk you'll want to put into the resources

sacred wing
#

So i can remove death controller?

thorny maple
#

from the client side entity file, yea, the death will only go into the behavior entity file

sacred wing
#

Ahh nice lemme try

#

Is animation controller need some changes

#

Because it didn't work lol

#

Oh nvm it worked

#

I have some typos

thorny maple
#

ahh ok lol, I was gonna say thats my next idea to try

sacred wing
#

Because it didn't work

thorny maple
#

would you mind sending me the files you are using? I can run through them and check for any syntax errors

sacred wing
#

I just fixed "controller.blox.death" into "controller.animation.blox.death" thought it would work

#

there's no syntax error showing

#

What file

thorny maple
#

the entity you are tying it to, and the death animation controller

sacred wing
#

Here

thorny maple
#

thats the file you are using right now?

sacred wing
#

Wym

#

Client entity?

#

oh yeah that was

#

the main

#

The other one is just for death animation when summoned

thorny maple
#

oh wait, maybe I worded it wrong-

So, the controller blox.walk is invalid when its in the same .json as blox.death

blox.walk needs to be in its own file in the resource pack while blox.death needs to be in the behavior pack in its own file

sacred wing
#

Actually the blox.walk controller works fine

#

it animates as walking,idle

#

Do i have to erase the blox.death

#

Or remove transition

thorny maple
#

yeah, so if the walk works, then cut the controller.animation.blox.death from the entire file. This controller should be in a new file in the behavior pack animation_controllers

sacred wing
#
        "controller.animation.blox.death": {
            "initial_state": "default",
            "states": {
                "default": {
                    "transitions": [{
                        "death": "!query.is_alive"
                    }]
                },
                "death": {
                    "on_entry": ["/summon c:blox_death ~~~", "/effect @s invisibility"]
                }
            }
        }
    }
}

Because query alive is the same in the behavior entity

sacred wing
#

behavior pack animation controller?

thorny maple
#

yeah, animation controllers exist in both folders, resource, and behavior

sacred wing
#

Ye i also noticed it, mostly commands works as behavior not for visual

#

Lemme try

thorny maple
#

resources can only control viewable ingame animations, which are visible, where the behaviors can control things like activating commands & setting variables which isn't something the players would typically see

sacred wing
#

Does b.e. animation controller the same as rp
I mean like

Format version
animation_controller
"Controller.blox"

thorny maple
#

yea, the controllers are written basically the same, its just animations can't be added to the behavior one, here is a file too (in case it might help) of the files in a behavior pack

#

I used a pig and it just spawns more pigs on death, as an example

sacred wing
#

Oh thanks

thorny maple
#

good luck with your pack ๐Ÿ‘๐Ÿฝ

sacred wing
#

Thank you

#

(but didn't work lmao)

#

I think i know whats lackin now

sacred wing
#

Oh yeah i figured it out

#

It must be like this

    "format_version": "1.19.0",
    "minecraft:entity": {
        "description": {
            "identifier": "c:blox",
            "is_summonable": true,
            "is_spawnable": true,
            "is_experimental": true,
            "scripts": {
                "animate": ["death"]
            },
            "animations": {
                "death": "controller.animation.blox.death"
            }
#

And another transition on animation controller

{
    "format_version": "1.10.0",
    "animation_controllers": {
        "controller.animation.blox.death": {
            "initial_state": "default",
            "states": {
                "default": {
                    "transitions": [
                        {
                            "death": "!query.is_alive"
                        }
                    ]
                },
                "death": {
                    "on_entry": [
                        "/say Here we go!",
                        "/summon c:blox_death"
                    ],
                    "transitions": [
                        {
                            "default": "query.is_alive"
                        }
                        ]
                }
            }
        }
    }
}
#

can be ```js
"query.is_alive && query.all_animations_finished"