Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/swing: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{MC/Exclusive|java}}
{{exclusive|java}}
{{Infobox command
{{Infobox command
|name=swing
|name=swing
|oplevel=2
|oplevel=2
}}
}}
Controls the swinging animation of entities' hands.
Controls the swinging animation of [[Minecraft:entities]]' hands.


== Syntax ==
== Syntax ==
: <code>/swing [<targets>] [<mainhand|offhand>]</code>
: <code>/swing [<targets>] [mainhand|offhand] [<animation>] [<duration>]</code>


== Arguments ==
== Arguments ==
{{MC/Argument|targets|entity}}
{{argument|targets|entity}}
: Specifies entities to swing. Defaults to the command executor.
: Specifies entities to swing. Defaults to {{cd|@s}} (the command executor).
: Not all entities{{MC/Info needed|which entities?}} will animate a swing on the client side.
: Not all entities will animate a swing on the client side.
: {{MC/Arg desc|je=entity|amount=multiple|type=entities}}
: {{arg desc|je=entity|amount=multiple|type=entities}}
{{cd|<mainhand{{!}}offhand>}}
{{cd|mainhand{{!}}offhand}}
: Specifies the arm to swing. Defaults to mainhand.
: Specifies the arm to swing. Defaults to {{cd|mainhand}}.
{{Argument|animation|swing_animation}}
: Specifies the swing animation to play. Defaults to {{cd|whack}}.
: {{arg desc|je=swing_animation}}
{{argument|duration|time}}
: Specifies the duration of the swing animation. Defaults to {{cd|6t}}.
: {{arg desc|je=time|min=1}}


== Result ==
== Result ==
Line 25: Line 31:


== Output ==
== Output ==
{{MC/Output table}}
{{Output table}}
{{MC/Output table|edition=je|On fail|0|0|0}}
{{Output table|edition=je|On fail|0|0|0}}
{{MC/Output table|On success|1|1|the number of targeted entities}}
{{Output table|On success|1|1|the number of targeted entities}}
{{MC/Output table}}
{{Output table}}


== History ==
== History ==
{{HistoryTable
{{HistoryTable
|{{MC/HistoryLine|java}}
|{{HistoryLine|java}}
|{{HistoryLine||26.1|dev=snap1|Added {{MC/Cmd|swing|link=none}}.}}
|{{HistoryLine||26.1|dev=snap1|Added {{cmd|swing|link=none}}.}}
|{{HistoryLine|||dev=snap3|Both arguments are now optional, and default to {{MC/Cd|@s}} and {{MC/Cd|mainhand}} respectively.}}
|{{HistoryLine|||dev=snap3|Both arguments are now optional, and default to {{cd|@s}} and {{cd|mainhand}} respectively.}}
|{{HistoryLine||26.3|dev=snap7|When used on a player, the player's attack strength will no longer be reset.|Added the {{cd|whack{{!}}stab}} and {{cd|duration}} arguments.}}
}}
}}


== Navigation ==
== Navigation ==
{{MC/Navbox new content|other}}
{{Navbox commands}}
{{MC/Navbox commands}}


de:Befehl/swing
[[Minecraft:es:Comandos/swing]]
ja:コマンド/swing
[[Minecraft:de:Befehl/swing]]
pt:Comandos/swing
[[Minecraft:ja:コマンド/swing]]
ru:Команды консоли/swing
[[Minecraft:pt:Comandos/swing]]
zh:命令/swing
[[Minecraft:ru:Команды консоли/swing]]
[[Minecraft:zh:命令/swing]]

Latest revision as of 11:14, 16 September 2026

Template:Exclusive Template:Infobox command Controls the swinging animation of Minecraft:entities' hands.

Syntax

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

Arguments

Template:Argument

Specifies entities to swing. Defaults to Template:Cd (the command executor).
Not all entities will animate a swing on the client side.
Template:Arg desc

Template:Cd

Specifies the arm to swing. Defaults to Template:Cd.

Template:Argument

Specifies the swing animation to play. Defaults to Template:Cd.
Template:Arg desc

Template:Argument

Specifies the duration of the swing animation. Defaults to Template:Cd.
Template:Arg desc

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

Template:Output table Template:Output table Template:Output table Template:Output table

History

Template:HistoryTable

Navigation

Template:Navbox commands

Minecraft:es:Comandos/swing Minecraft:de:Befehl/swing Minecraft:ja:コマンド/swing Minecraft:pt:Comandos/swing Minecraft:ru:Команды консоли/swing Minecraft:zh:命令/swing