Commands/playanimation

From Minecraft Wiki
Jump to: navigation, search
Information icon.svg
This feature is exclusive to Bedrock Edition.
This article is missing information about how it works.
Please expand the article to include this information. Further details may exist on the talk page.
playanimation
Restrictions

Operator

First introduced

BE 1.16.100 (1.16.100.52)

Makes one or more entities play a one-off animation.

Syntax[edit]

playanimation <entity: target> <animation: string> [next_state: string] [blend_out_time: float] [stop_expression: string] [controller: string]

Arguments[edit]

entity: target: CommandSelector<Actor>

Must be a player name or a target selector.
Specifies the targeted entities.

animation: string: basic_string

Must be a string. And it must be either a single word (no spaces) or a quoted string.
Should be an animation name (e.g. animation.wolf.angry), or an animation defined under the Json path "minecraft:client_entity"."animations" in the <a_resource_pack>/entity/<entity_name>.entity.json file (e.g. wolf_angry for only wolf entity).
Specifies an animation to play now.

next_state: basic_string

Must be a string. And it must be either a single word (no spaces) or a quoted string.
Should be an animation name, or an animation defined under the Json path "minecraft:client_entity"."animations" in the <a_resource_pack>/entity/<entity_name>.entity.json file.
Specifies the animation after the first animation stops playing.

blend_out_time: float: float

Must be a Single-precision floating-point format number.
Specifies the duration of the gradient animation.

stop_expression: string: basic_string

Must be a string. And it must be either a single word (no spaces) or a quoted string.
Should be a MoLang expression.[more information needed]
Specifies the conditions for stopping animation.

controller: string: basic_string

Must be a string. And it must be either a single word (no spaces) or a quoted string.
Should be an animation controller name (such as controller.animation.villager_v2.move), or an animation controller defined under the Json path "minecraft:client_entity"."animation_controllers" in the <a_resource_pack>/entity/<entity_name>.entity.json file[needs testing].
Specifies an animation controller.

Result[edit]

CommandTriggerBedrock Edition
anythe arguments are not specified correctly Failed
if entity: target fails to resolve to one or more online entities (named players must be online)
On successSends the animation request to clients for processing.

Output[edit]

CommandEditionSituationSuccess Count
anyBedrock EditionOn fail0
On success1

Example[edit]

Make the foxes sit down until they leave the ground. Once leaving the ground, the foxes become in sleep state:

/playanimation @e[type=fox] sit sleep 0 "!query.is_on_ground"

History[edit]

Bedrock Edition
1.16.100beta 1.16.100.52Added /playanimation.