Updated:

First: allow commands

In single player, turn on cheats (commands) in the world settings. On Bedrock, turning cheats on disables achievements for that world. On a server you need operator rights.

1. Show coordinates

/gamerule showcoordinates true

Shows your position in the top left on Bedrock. On Java, press F3. Showing coordinates

2. Keep items when you die

/gamerule keep_inventory true

On Java 1.21.10 and older, and on Bedrock, the rule is keepInventory. Keep inventory guide

3. One player sleeps, everyone skips the night

/gamerule players_sleeping_percentage 0

On Java this sets the share of players who must sleep. On 1.21.10 and older it is playersSleepingPercentage. One player sleep

4. Make it day and keep it day

/time set day
/gamerule advance_time false

The second line stops time. On 1.21.10 and older use doDaylightCycle; on Bedrock /alwaysday true also works. Time command

5. Clear the weather

/weather clear

Stops rain and thunder at once. To keep it clear, stop the weather cycle too. Weather command

6. Find the nearest village or stronghold

/locate structure minecraft:village_plains

Shows the coordinates of the nearest one. Strongholds are minecraft:stronghold. Locate command

7. See in the dark (night vision)

/effect give @s minecraft:night_vision infinite 0 true

Caves and oceans become bright. On Bedrock use /effect @s night_vision 99999 0 true. Effect command

8. Clear dropped items

/kill @e[type=minecraft:item]

Removes items lying on the ground and reduces lag. Never run @e alone, which also kills you and your animals. Kill command

9. Get experience levels

/xp add @s 30 levels

Thirty levels for enchanting. On Bedrock use /xp 30L @s. XP command

10. Respawn where you stand

/spawnpoint @s

You come back here after dying. Sleeping in a bed overwrites it. Spawnpoint command

11. Teleport home

/tp @s 100 70 -200

Note your base coordinates and you can always return. TP command

12. Fly

/gamemode creative

Double-tap jump to fly in creative. Switch back with /gamemode survival. Fly command

13. Go to the Nether

/execute in minecraft:the_nether run tp @s 0 80 0

On Java this skips the portal. You may land inside rock, so look around as soon as you arrive. Above Y=128 is the top of the bedrock ceiling, so avoid that. Nether and End teleport

14. Get more hearts

/attribute @s minecraft:max_health base set 40

On Java 1.21.2+ this gives 20 hearts. On 1.21.1 and older use minecraft:generic.max_health. Max health command

15. Find your seed

/seed

Shows the world seed on Java. On Bedrock, check the settings screen. Seed command

Things to keep in mind

Common questions

Check your command

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