News
Game
Guides
Downloads
Versions
/swing
COMMANDS PLAYERS & MOVEMENT CHEATS · LEVEL 2 Added in 26.1

/swing command in Minecraft

/swing plays the arm swing animation on living entities, with the main hand or the off hand. Without arguments it applies to you. It gives cutscenes, NPCs and machinima a little life, and it does not deal any damage on its own.

Syntax

/swing [<targets> [mainhand|offhand]]
ArgumentExpectsWhat it does
targetsoptionalEntity selectorone or severalEntities that swing: @s, @a or @e[type=minecraft:zombie]. Only living entities react. Defaults to you.
animationoptionalAnimationType of swing animation, checked by the game. An unknown value is rejected with an error.
durationoptionalDuration (ticks, or 10s, 2d)at least 1Length of the animation, at least one tick, written like 10t, 1s or 1d.
All 8 forms
  • /swing
  • /swing <targets>
  • /swing <targets> mainhand
  • /swing <targets> mainhand <animation>
  • /swing <targets> mainhand <animation> <duration>
  • /swing <targets> offhand
  • /swing <targets> offhand <animation>
  • /swing <targets> offhand <animation> <duration>

Examples

Swing your own arm

/swing

Plays the swing animation on you, with the main hand.

Java 26.3

Nearby zombies swing together

/swing @e[type=minecraft:zombie,distance=..10] mainhand

Every Zombie within 10 blocks swings its main arm at once.

Java 26.3

Swing with the off hand

/swing @s offhand

Plays the animation with your off hand instead of the main hand.

Java 26.3
Build your command

Fill in the fields, then copy the command.

Command generator

What the syntax allows

targets accepts any selector, but only living entities swing; otherwise the game answers "No living entities were found to swing". After the targets, mainhand or offhand picks the arm. Two optional arguments follow: animation, a swing animation type checked by the game ("Unknown swing animation type: x" for a wrong value), and duration, a time of at least one tick, written with t, s or d.

Uses

Turn a Villager first with /rotate, then make it swing, or spawn an actor with /summon. To actually hurt something, use /damage.

✓ Checked in Java Edition 26.3 · updated 2 November 2026

/swing: FAQ

Does /swing hit the entity in front?

No. It only plays the arm animation. Use /damage to deal damage.

Why does /swing say no living entities were found?

The selector only matched entities that cannot swing, such as boats or dropped items. Target players or mobs instead.

How do I use /swing?

Type it in the chat with cheats on: /swing [<targets> [mainhand|offhand]].

Who can use /swing?

Cheats on, or operator level 2.

Since when does /swing exist?

It is in the official command tree since Java Edition 26.1.

Related commands