Command Basics

Commands require cheats enabled: check 'Allow Cheats' at world creation, or enable when opening to LAN. In singleplayer you can type commands directly (survival needs cheats on first). Commands start with /, press Tab to auto-complete. Type /help for the full command list.

Item & Entity Commands

/give is the most-used command — gives items to yourself or others. /summon spawns mobs/entities. See examples in the table below. English IDs are key: diamond, diamond_sword, ender_dragon.

CommandEffectExample
/give @p item countGive nearest player items/give @p diamond 64
/give @s itemGive yourself items/give @s diamond_sword 1
/summon mobSpawn a mob/summon ender_dragon
/kill @eRemove all entities/kill @e[type=zombie]
/enchantEnchant held item/enchant @s sharpness 5

Teleport & Gamemode

/tp teleports: /tp player coords (e.g. /tp @s 100 64 100), /tp playerA playerB (teleport to another player). /gamemode switches mode: survival, creative, adventure, spectator. /spawnpoint sets respawn point. /setworldspawn sets world spawn. /setblock and /fill place and mass-fill blocks.

Time, Weather & Game Rules

/time: /time set day, /time set noon, /time set night. /weather: /weather clear, /weather rain, /weather thunder. /gamerule: /gamerule keepInventory true (keep items on death), /gamerule doFireTick false (disable fire spread), /gamerule mobGriefing false (disable creeper/enderman griefing). /difficulty: peaceful/easy/normal/hard.

✓ Last verified on Minecraft 1.22 (2026-09-22) Minecraft mechanics change with every update — this guide is only guaranteed to work in the stated version.