Wiki ArticleJava EditionInformation neededCommands

/swing

Controls the swinging animation of entities' hands.​[more information needed]

This feature is exclusive to Java Edition.
 

Controls the swinging animation of entities' hands.​[more information needed]

Syntax

/swing [<targets>] [<mainhand|offhand>]

Arguments

<targets>: entity

Specifies entities to swing. Defaults to the command executor.
Not all entities​[more information needed] will animate a swing on the client side.
Must be a player name, a target selector or a UUID.

<mainhand|offhand>

Specifies the arm to swing. Defaults to mainhand.

Result

CommandTriggerJava Edition
AnyThe command is incomplete, or any argument is not specified correctly. Unparseable
<targets> fails to resolve to one or more entities. Failed
OtherwiseSuccessful

Output

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
AnyJava EditionOn fail000
On success11the number of targeted entities

History

Java Edition
26.1snap1Added /swing.
snap3Both arguments are now optional, and default to @s and mainhand respectively.