[Minecraft Guide] Common Command List

2023.08.03 / Minecraft / 繁體中文
Minecraft commands are an important function for players to control the game world, blocks, or items. Typically, players need to enable cheat mode in single-player worlds or have admin or specific permissions on multiplayer servers to use commands. This article organizes commonly used commands in Minecraft into a list and explains them in simple terms, so you can easily copy and paste them whenever you need!

Enabling Command Permissions

  1. Enable Allow Cheats when creating a single-player world.
  2. If you forget to enable Allow Cheats, you can still open the game menu by pressing ESC and selecting Open to LAN.
  3. Enable Allow Cheats and then click Start LAN World.

Quick Command Input

  1. Press / on the keyboard in-game to open the chat.
  2. Type part of the command, use the arrow keys to select the complete command, and press Tab to finish typing. For example, for the gamerule command, you can just type game and use the arrow keys and Tab to quickly select it.
  3. You can do the same for subsequent parameters to reduce typing errors and speed up the process.
  4. Of course, you can also quickly double-click and copy any commands from this article to paste them into the game.

Selecting Players or Entities

CommandDescription
@pNearest player; if entered by a player, it targets themselves
@rRandom player
@aAll players
@eAll entities, including animals, neutral, and hostile mobs
@sThe player or entity executing the command; if entered by a player, it targets themselves

Game Modes

CommandDescription
/gamemode creativeCreative
/gamemode survivalSurvival
/gamemode spectatorSpectator
/gamemode adventureAdventure

Game Difficulty

CommandDescription
/difficulty peacefulPeaceful, no hostile mobs, hunger does not decrease
/difficulty easyEasy, players take 0.5x damage
/difficulty normalNormal, players take 1x damage
/difficulty hardHard, players take 1.5x damage, zombies can break doors

Game Time

CommandDescription
/time set dayMorning
/time set noonNoon
/time set nightNight
/time set midnightMidnight

Game Weather

CommandDescription
/weather clearClear
/weather rainRain
/weather thunderThunderstorm

Game Rules

Keep Inventory on Death

Set whether players keep their inventory when they die.

CommandDescription
/gamerule keepInventory trueEnable
/gamerule keepInventory falseDisable

Mob Griefing

Set whether mobs like creepers or withers can destroy blocks or terrain.

CommandDescription
/gamerule mobGriefing trueEnable
/gamerule mobGriefing falseDisable

Fire Spread

Set whether fire spreads to adjacent blocks.

CommandDescription
/gamerule doFireTick trueEnable
/gamerule doFireTick falseDisable

Spawn Radius

Set the radius for players’ respawn coordinates.

CommandDescription
/gamerule spawnRadius 1Fixed respawn point
/gamerule spawnRadius 50Random respawn within a 50-block radius

Skip Night

Set conditions for skipping the night when players sleep.

CommandDescription
/gamerule playersSleepingPercentage 0Skip night when one player sleeps
/gamerule playersSleepingPercentage 101Disable night skipping

Phantom Spawning

Set whether phantoms spawn when players haven’t slept for three days.

CommandDescription
/gamerule doInsomnia trueEnable
/gamerule doInsomnia falseDisable

Daylight Cycle

Set whether the game has a day-night cycle. This setting does not affect game time, which continues to flow and is influenced by time settings.

CommandDescription
/gamerule doDaylightCycle trueEnable
/gamerule doDaylightCycle falseDisable

Player Experience

Set player experience points. Use selectors to target a player or enter a player name directly.

CommandDescription
/xp add @p 999 levelsAdd 999 levels to the nearest player
/xp add @p 999 pointsAdd 999 experience points to the nearest player
/xp query @p levelsQuery the nearest player’s level
/xp query @p pointsQuery the nearest player’s experience points
/xp set @p 999 levelsSet the nearest player to level 999
/xp set @p 1 pointsSet the nearest player’s experience to 1 point

Locating Structures

Locate the nearest structure (building) or biome. After inputting the command, you can click the green coordinates, and the system will automatically fill in the tp command. Note: In survival mode, you might suffocate if stuck in terrain.

CommandDescription
/locate structure minecraft:ancient_cityAncient City
/locate structure minecraft:mansionWoodland Mansion

Giving Items

Give items to players. Use selectors to target a player, and NBT tags to set properties.

CommandDescription
/give @p minecraft:wooden_axeWooden Axe
/give @p minecraft:iron_ingotIron Ingot
/give @p minecraft:gold_ingotGold Ingot
/give @p minecraft:diamondDiamond
/give @p minecraft:netherite_ingotNetherite Ingot

Applying Potions

Apply potion effects to players or entities. Use selectors to target a player.

Effect strength can be set from 0 to 255.

Clearing Effects

CommandDescription
/effect clear @pRemove all effects

Regeneration Effect

CommandDescription
/effect give @p minecraft:regeneration 6060 seconds duration
/effect give @p minecraft:regeneration 60 25560 seconds duration, strength 255
/effect give @p minecraft:regeneration 60 255 true60 seconds duration, strength 255, hidden particles
/effect give @p minecraft:regeneration infinite 255 trueInfinite duration, strength 255, hidden particles

Night Vision Effect

CommandDescription
/effect give @p minecraft:night_vision 6060 seconds duration
/effect give @p minecraft:night_vision 60 25560 seconds duration, strength 255
/effect give @p minecraft:night_vision 60 255 true60 seconds duration, strength 255, hidden particles
/effect give @p minecraft:night_vision infinite 255 trueInfinite duration, strength 255, hidden particles

Other Commands

CommandDescription
/killKill yourself
/kill @pKill specific player
/clearRemove all your items, weapons and armors in inventory, it’s available with creative mode.

相關文章

    Ted Liou

    雲科碩士在讀中,專注於 Unity C#、TouchDesigner 技術,常把技術筆記分享到部落格,偶爾還直接挪用文章來當教材的研究生。