/swing
< Commands
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 |
{
"title": "<code>/swing</code>",
"rows": [
{
"field": "2",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "None",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
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
| Command | Trigger | Java Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable |
<targets> fails to resolve to one or more entities. | Failed | |
| Otherwise | Successful |
Output
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | 0 | 0 | 0 |
| On success | 1 | 1 | the number of targeted entities |
History
| Upcoming Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 26.1 | snap1 | Added /swing. | |||||
| snap3 | Both arguments are now optional, and default to @s and mainhand respectively. | ||||||