/swing

This article describes content that is currently in development for Java Edition.
 
This content has appeared in development versions for Java Edition 26.1, but the full update adding it has not been released yet.
/swing
Permission level
required

2

Restrictions

None

Controls the swinging animation of entities' hands.

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

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

Navigation