News
Game
Guides
Downloads
Versions
Essential survival commands in Minecraft
COMMANDSCOPY & PASTEJAVA 26.3

Essential survival commands in Minecraft

These commands save time in a survival world: find a village or a biome, get back to your base, keep your items after death or end a storm. They need cheats on, so open your world to LAN with Allow Cheats if you did not turn commands on at creation.

Before you pasteCheats must be on. Commands longer than 256 characters only work in a command block.

The commands

Find the nearest village

/locate structure #minecraft:village

Gives the distance and coordinates of the closest village of any type.

Java 26.3 36 characters · chat OK

Find trial chambers

/locate structure minecraft:trial_chambers

Locates the nearest trial chambers, with their trial spawners and vaults.

Java 26.3 42 characters · chat OK

Find a biome

/locate biome minecraft:cherry_grove

Finds the nearest Cherry Grove; replace the ID with any biome.

Java 26.3 36 characters · chat OK

Teleport to coordinates

/tp @s 1250 ~ -430

Takes you to X 1250 and Z -430, keeping your current height.

Java 26.3 18 characters · chat OK

Set your respawn point here

/spawnpoint @s ~ ~ ~

You respawn exactly where you stand, no bed needed.

Java 26.3 20 characters · chat OK

Keep items after death

/gamerule keep_inventory true

Your inventory and experience stay with you when you die.

Java 26.3 29 characters · chat OK

Permanent night vision

/effect give @s night_vision infinite 0 true

See in caves and under water at any hour, without particles.

Java 26.3 44 characters · chat OK

Make it day

/time set day

Jumps to morning, before mobs come out again.

Java 26.3 13 characters · chat OK

Stop the rain

/weather clear

Ends rain or a thunderstorm right away.

Java 26.3 14 characters · chat OK

Get 30 levels

/xp add @s 30 levels

Enough experience for an enchantment at the strongest level.

Java 26.3 20 characters · chat OK

Show the world seed

/seed

Displays the seed, handy to share the world or use a seed map.

Java 26.3 5 characters · chat OK

How to use them

Type each command in the chat. /locate answers with the distance and coordinates in green; click them to fill in a teleport. Use /teleport for the trip and /spawnpoint to respawn at your base without a bed. Village and structure locations come from the world seed, which /seed shows.

Tips

  • /locate structure shows the height as ~, so the teleport keeps your current height: you may land in the air or inside a hill.
  • Look for the Trial Chambers underground; they are deep below the surface.
  • Night vision with infinite and true lasts forever and hides the particles.

Common errors

Could not find a structure of type means there is none within the search range, or that it does not exist in this dimension: a village never appears in the Nether. Commands are refused in a world without cheats; turn them on through the LAN menu.

✓ Checked in Java Edition 26.3 · updated 2 November 2026

FAQ

Do commands disable achievements?

Advancements still work in Java Edition when you use commands. The world is simply marked as a world where cheats have been used.

How do I go back to my base after dying?

Set your respawn point at the base with /spawnpoint, or note its coordinates and use /tp. With keep_inventory on, your items come with you.

Commands used on this page

/locateFind the nearest structure, biome or POI/teleportTeleport players and entities/spawnpointSet a player's respawn point/gameruleRead or change the game rules of a world/effectGive or clear status effects/timeSet, speed up or pause the world clock/weatherChange the weather: clear, rain or thunder/experienceAdd, set or check experience/seedShow the seed of the current world