Updated:
First: turn on commands
In single player, turn on cheats. See commands on Java and commands on Bedrock. Examples are Java unless noted.
1. Become a giant or tiny
/attribute @s minecraft:scale base set 5
/attribute @s minecraft:scale base set 0.3
Set it back to 1 to undo. This is Java 1.21.2+; on 1.20.5 to 1.21.1 use minecraft:generic.scale. See the attribute guide.
2. Super jump
/attribute @s minecraft:jump_strength base set 1
Jump onto rooftops. The normal value is 0.42. Fall damage hurts, so pair it with number 10. Java 1.21.2+.
3. TNT rain
/execute at @a run summon minecraft:tnt ~ ~10 ~ {fuse:60}
TNT appears 10 blocks above every player and explodes after 3 seconds. Test world only. See the TNT guide.
4. Knockback stick
/give @p stick[enchantments={knockback:10},custom_name="Knockback Stick"] 1
Sends anything you hit flying. Java 1.21.5+; other versions are in the knockback stick guide.
5. Turn pigs into zombified piglins
/execute at @e[type=minecraft:pig,distance=..20] run summon minecraft:lightning_bolt ~ ~ ~
Lightning strikes nearby pigs and turns them into zombified piglins. Villagers become witches and creepers become charged. Keep away from wooden builds (lightning guide).
6. Float into the air
/effect give @s minecraft:levitation 5 1 true
You float upward for 5 seconds, then fall. Use slow_falling for a gentle landing (fly guide).
7. Make every nearby mob glow
/effect give @e[type=!minecraft:player,distance=..30] minecraft:glowing 30 0 true
Outlines show through walls, which is great for hide and seek (glowing guide).
8. Baby zombie
/summon minecraft:zombie ~ ~ ~ {IsBaby:1b}
Small and fast. More in the baby mob guide.
9. Fireworks
Launch fireworks with your own colors and shapes. The syntax changes a lot by version, so copy the example for yours from the firework guide.
10. Invincibility
/effect give @s minecraft:resistance infinite 4 true
Blocks almost all damage. Bedrock: /effect @s resistance 99999 4 true (invincibility guide).
11. The strongest sword
Java /give can put enchantment levels far past the normal cap on a sword. See the strongest sword guide for your version.
12. Call the ender dragon
/summon minecraft:ender_dragon ~ ~10 ~ {DragonPhase:0}
A dragon appears in the Overworld and flies around. It wrecks terrain, so only use it in a test world (ender dragon guide).
Play safely
- Back up first: TNT and the dragon can do damage you cannot undo.
- Ask before using them on a shared world.
- Know how to undo:
/effect clear @sfor effects, and set scale back to1.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.