Updated:

The command

# Java 1.21.5 and later
/give @p minecraft:stick[enchantments={knockback:10},custom_name="Knockback Stick"] 1
# Java 1.20.5–1.21.4
/give @p minecraft:stick[enchantments={levels:{knockback:10}}] 1

/enchant refuses because sticks cannot normally be enchanted. /give attaches the enchantment from the start.

How far each level goes

LevelResult
2Normal maximum; a small push
5Several blocks
10Far; good for PvP arenas
50+Out of sight; one hit knocks anyone off a platform

Armor and sprint attacks also change the distance, so test before an event.

A knockback arena

  1. Build a platform high in the air, for example a 15-block circle at Y=100.
  2. Give everyone a stick: /give @a minecraft:stick[enchantments={knockback:10}] 1
  3. Put players in Adventure mode so they cannot break the platform.
  4. In a repeating, always active command block, turn fallen players into spectators:
/execute as @a[gamemode=adventure] at @s if entity @s[y=-64,dy=150] run gamemode spectator @s

This catches Adventure players between Y=-64 and Y=86, below the platform. Adjust the range to your build.

Taking less knockback (Java)

How far a player flies depends on the knockback resistance attribute. 0 is normal and 1 means no knockback at all.

# No knockback (Java 1.21.2 and later)
/attribute @p minecraft:knockback_resistance base set 1
# Back to normal
/attribute @p minecraft:knockback_resistance base set 0
# Java 1.21.1 and earlier use generic.knockback_resistance

For a fair arena, have everyone take off armor or wear the same set.

Bedrock Edition

Bedrock's /enchant cannot put Knockback on a stick or go above level II, and /give cannot add enchantments. Use a Knockback II sword or a behavior pack instead.

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.