Minecraft Commands List and Gamerule Table
Explanations of all Minecraft commands, the new gamerule names changed in 26.x and effect codes on a single page; with examples.
keepInventory → keep_inventory, doDaylightCycle → advance_time). With 1.21.5 the format of enchantment and text commands also changed. The examples on this page are for current versions (1.21.11 and 26.x); old names are listed next to them in the table.Minecraft commands list
| Command | What does it do? | Sample |
|---|---|---|
| Players and Items | ||
| /give | Gives an item to the player. For enchanted or named items use the /give Generator. | /give @p diamond_sword 1 |
| /clear | Clears the player's inventory (or a specific item). | /clear @p dirt |
| /enchant | Applies an enchantment to the item in your hand (normal level at most). | /enchant @p sharpness 5 |
| /xp (experience) | Adds / sets XP points or levels. | /xp add @p 30 levels |
| /effect | Gives or removes an effect. You can write infinite instead of a duration. | /effect give @p speed infinite 1 true |
| /gamemode | Changes the game mode: survival, creative, adventure, spectator. | /gamemode creative @p |
| /item | Replaces or modifies an item in an inventory slot. | /item replace entity @p armor.head with diamond_helmet |
| /attribute | Changes a player's attributes such as health, speed and size. | /attribute @p minecraft:scale base set 1.5 |
| /recipe | Adds or removes recipes in the recipe book. | /recipe give @p * |
| /advancement | Grants or revokes advancements. | /advancement grant @p everything |
| Teleportation and World | ||
| /tp (teleport) | Teleports the player to a coordinate or to another player. | /tp @p 100 64 -200 |
| /spawnpoint | Sets the player's spawn point. | /spawnpoint @p ~ ~ ~ |
| /setworldspawn | Sets the world's spawn point. | /setworldspawn 0 70 0 |
| /locate | Finds the nearest structure, biome or POI. | /locate structure minecraft:village_plains |
| /worldborder | Sets the world border. | /worldborder set 10000 |
| /time | Sets the time: day, night, noon, midnight or a tick value. | /time set day |
| /weather | Changes the weather: clear, rain, thunder. | /weather clear |
| /difficulty | Changes the difficulty: peaceful, easy, normal, hard. | /difficulty hard |
| /gamerule | Changes a game rule (table below). Since 1.21.11 the names are snake_case. | /gamerule keep_inventory true |
| /seed | Shows the world's seed. | /seed |
| /tick | Freezes, speeds up or steps the game speed. | /tick rate 40 |
| Blocks and Structures | ||
| /setblock | Changes a single block. | /setblock ~ ~-1 ~ diamond_block |
| /fill | Fills an area with a block (up to 32,768 blocks, can be raised with a gamerule). | /fill ~-5 ~ ~-5 ~5 ~ ~5 stone |
| /clone | Copies an area to another place. | /clone 0 64 0 10 70 10 100 64 100 |
| /place | Places a structure, tree or jigsaw piece. | /place structure minecraft:village_plains |
| /fillbiome | Changes the biome of an area. | /fillbiome ~-10 ~-10 ~-10 ~10 ~10 ~10 minecraft:cherry_grove |
| Entity | ||
| /summon | Spawns a mob or entity. | /summon zombie ~ ~ ~ {NoAI:1b} |
| /kill | Kills entities. Use @e[type=item] to delete items on the ground. | /kill @e[type=item] |
| /damage | Deals a specific type of damage to an entity. | /damage @p 5 minecraft:magic |
| /ride | Mounts or dismounts an entity onto another. | /ride @p mount @e[type=horse,limit=1,sort=nearest] |
| /data | Reads or modifies entity and block data (NBT). | /data get entity @p Health |
| /fetchprofile | (1.21.9+) Fetches a player profile and generates a static head command. | /fetchprofile name Notch |
| Chat and Text | ||
| /tellraw | Sends a colored, clickable chat message. | /tellraw @a {text:"Merhaba",color:"gold"} |
| /title | Shows a large title, subtitle or action bar in the middle of the screen. | /title @a title {text:"Hoş geldin!",color:"aqua"} |
| /say | Sends a message to everyone with the [Name] prefix. | /say Sunucu 5 dakika sonra yeniden başlayacak |
| /msg (tell, w) | Sends a private message. | /msg Steve selam |
| /me | Sends an action message. | /me dans ediyor |
| Server Administration | ||
| /op, /deop | Grants / revokes operator status. Using LuckPerms for permissions is safer. | /op Steve |
| /ban, /ban-ip, /pardon | Bans and unbans a player or an IP. | /ban Steve Hile kullanımı |
| /kick | Kicks a player from the server. | /kick Steve Küfür |
| /whitelist | Turns on the whitelist, adds / removes players. | /whitelist add Steve |
| /list | Lists the online players. | /list uuids |
| /save-all, /stop | Saves the world / safely stops the server. | /save-all flush |
| /transfer | (1.20.5+) Transfers the player to another server address (the target must have accepts-transfers=true). | /transfer lobi.sunucun.com 25565 @p |
| /execute | Runs the command as another player, at a position or under a condition. | /execute as @a at @s run setblock ~ ~-1 ~ gold_block |
| /function, /reload | Runs a datapack function / reloads datapacks. | /function ornek:baslat |
| /scoreboard, /team | Scoreboard and team management. | /team add kirmizi |
Click an example to copy it. To type a command in game, start with / in chat; in a command block you don't need to type /. In a single-player world "Allow Cheats" must be on for commands.
Gamerule list (with new and old names)
| New name (1.21.11+) | Old name | Default | Description |
|---|---|---|---|
advance_time |
doDaylightCycle | true |
Advance time of day |
advance_weather |
doWeatherCycle | true |
Update weather |
allow_entering_nether_using_portals |
allowEnteringNetherUsingPortals | true |
Allow Nether Controls whether players are allowed to enter the Nether. |
block_drops |
doTileDrops | true |
Drop blocks Controls resource drops from blocks, including experience orbs. |
block_explosion_drop_decay |
blockExplosionDropDecay | true |
In block interaction explosions, some blocks won't drop their loot Some of the drops from blocks destroyed by explosions caused by block interactions are lost in the explosion. |
command_block_output |
commandBlockOutput | true |
Broadcast command block output |
command_blocks_work |
commandBlocksEnabled | true |
Enable Command Blocks |
drowning_damage |
drowningDamage | true |
Deal drowning damage |
elytra_movement_check |
disableElytraMovementCheck inverted | true |
Do elytra movement check |
ender_pearls_vanish_on_death |
enderPearlsVanishOnDeath | true |
Thrown Ender Pearls vanish on death Whether Ender Pearls thrown by a player vanish when that player dies. |
entity_drops |
doEntityDrops | true |
Drop entity equipment Controls drops from minecarts (including inventories), item frames, boats, etc. |
fall_damage |
fallDamage | true |
Deal fall damage |
fire_damage |
fireDamage | true |
Deal fire damage |
fire_spread_radius_around_player |
doFireTick (+ allowFireTicksAwayFromPlayer) | 128 |
Fire spread radius The radius in blocks around a player in which fire can spread |
forgive_dead_players |
forgiveDeadPlayers | true |
Forgive dead players Angered neutral mobs stop being angry when the targeted player dies nearby. |
freeze_damage |
freezeDamage | true |
Deal freeze damage |
global_sound_events |
globalSoundEvents | true |
Global sound events When certain game events happen, like a boss spawning, the sound is heard everywhere. |
immediate_respawn |
doImmediateRespawn | false |
Respawn immediately |
keep_inventory |
keepInventory | false |
Keep inventory after death |
lava_source_conversion |
lavaSourceConversion | false |
Lava converts to source When flowing lava is surrounded on two sides by lava sources, it converts into a source. |
limited_crafting |
doLimitedCrafting | false |
Require recipe for crafting If enabled, players will be able to craft only unlocked recipes. |
locator_bar |
locatorBar | true |
Enable player Locator Bar When enabled, a bar is shown on the screen to indicate the direction of players. |
log_admin_commands |
logAdminCommands | true |
Broadcast admin commands |
max_block_modifications |
commandModificationBlockLimit | 32768 |
Command modification block limit The number of blocks that can be changed at once by one command, such as fill or clone. |
max_command_forks |
maxCommandForkCount | 65536 |
Command context limit Maximum number of contexts that can be used by commands like 'execute as'. |
max_command_sequence_length |
maxCommandChainLength | 65536 |
Command chain size limit Applies to command block chains and functions. |
max_entity_cramming |
maxEntityCramming | 24 |
Entity cramming threshold |
max_minecart_speed |
minecartMaxSpeed | 8 |
Minecart max speed Maximum default speed of a moving Minecart on land. |
max_snow_accumulation_height |
snowAccumulationHeight | 1 |
Snow accumulation height When it snows, layers of snow form on the ground up to at most this number of layers. |
mob_drops |
doMobLoot | true |
Drop mob loot Controls resource drops from mobs, including experience orbs. |
mob_explosion_drop_decay |
mobExplosionDropDecay | true |
In mob explosions, some blocks won't drop their loot Some of the drops from blocks destroyed by explosions caused by mobs are lost in the explosion. |
mob_griefing |
mobGriefing | true |
Allow destructive mob actions |
natural_health_regeneration |
naturalRegeneration | true |
Regenerate health |
player_movement_check |
disablePlayerMovementCheck inverted | true |
Do player movement check |
players_nether_portal_creative_delay |
playersNetherPortalCreativeDelay | 0 |
Player's Nether Portal delay in creative mode Time (in ticks) that a creative mode player needs to stand in a Nether Portal before changing dimensions. |
players_nether_portal_default_delay |
playersNetherPortalDefaultDelay | 80 |
Player's Nether Portal delay in non-creative mode Time (in ticks) that a non-creative mode player needs to stand in a Nether Portal before changing dimensions. |
players_sleeping_percentage |
playersSleepingPercentage | 100 |
Sleep percentage The percentage of players who must be sleeping to skip the night. |
projectiles_can_break_blocks |
projectilesCanBreakBlocks | true |
Projectiles can break blocks Controls whether impact projectiles will destroy blocks that are destructible by them. |
pvp |
pvp | true |
Enable pvp Controls whether players are allowed to damage other players. |
raids |
disableRaids inverted | true |
Do raids |
random_tick_speed |
randomTickSpeed | 3 |
Random tick speed rate |
reduced_debug_info |
reducedDebugInfo | false |
Reduce debug info Limits contents of debug screen. |
respawn_radius |
spawnRadius | 10 |
Respawn location radius Controls the size of the area around the spawn point that players can spawn in. |
send_command_feedback |
sendCommandFeedback | true |
Send command feedback |
show_advancement_messages |
announceAdvancements | true |
Announce advancements |
show_death_messages |
showDeathMessages | true |
Show death messages |
spawn_mobs |
doMobSpawning | true |
Spawn mobs Some entities might have separate rules. |
spawn_monsters |
spawnMonsters | true |
Spawn Monsters Controls whether monsters naturally spawn. |
spawn_patrols |
doPatrolSpawning | true |
Spawn pillager patrols |
spawn_phantoms |
doInsomnia | true |
Spawn phantoms |
spawn_wandering_traders |
doTraderSpawning | true |
Spawn Wandering Traders |
spawn_wardens |
doWardenSpawning | true |
Spawn Wardens |
spawner_blocks_work |
spawnerBlocksEnabled | true |
Enable Spawner Blocks |
spectators_generate_chunks |
spectatorsGenerateChunks | true |
Allow spectators to generate terrain |
spread_vines |
doVinesSpread | true |
Vines spread Controls whether the Vines block spreads randomly to adjacent blocks. Does not affect other types of vine blocks such as Weeping Vines, Twisting Vines, etc. |
tnt_explodes |
tntExplodes | true |
Allow TNT to be activated and to explode |
tnt_explosion_drop_decay |
tntExplosionDropDecay | false |
In TNT explosions, some blocks won't drop their loot Some of the drops from blocks destroyed by explosions caused by TNT are lost in the explosion. |
universal_anger |
universalAnger | false |
Universal anger Angered neutral mobs attack any nearby player, not just the player that angered them. Works best if forgiveDeadPlayers is disabled. |
water_source_conversion |
waterSourceConversion | true |
Water converts to source When flowing water is surrounded on two sides by water sources, it converts into a source. |
For rules marked "Inverted" the meaning is reversed: the old disableRaids true now means raids false. Instead of doFireTick false, fire_spread_radius_around_player 0 is now used. Source: Minecraft 26.2 game files and the 25w44a release notes.
Effect codes
| Effect | Code | Command |
|---|---|---|
| Absorption | absorption | /effect give @p absorption 60 0 |
| Bad Omen | bad_omen | /effect give @p bad_omen 60 0 |
| Blindness | blindness | /effect give @p blindness 60 0 |
| Breath of the Nautilus | breath_of_the_nautilus | /effect give @p breath_of_the_nautilus 60 0 |
| Conduit Power | conduit_power | /effect give @p conduit_power 60 0 |
| Darkness | darkness | /effect give @p darkness 60 0 |
| Dolphin's Grace | dolphins_grace | /effect give @p dolphins_grace 60 0 |
| Fire Resistance | fire_resistance | /effect give @p fire_resistance 60 0 |
| Glowing | glowing | /effect give @p glowing 60 0 |
| Haste | haste | /effect give @p haste 60 0 |
| Health Boost | health_boost | /effect give @p health_boost 60 0 |
| Hero of the Village | hero_of_the_village | /effect give @p hero_of_the_village 60 0 |
| Hunger | hunger | /effect give @p hunger 60 0 |
| Infested | infested | /effect give @p infested 60 0 |
| Instant Damage | instant_damage | /effect give @p instant_damage 60 0 |
| Instant Health | instant_health | /effect give @p instant_health 60 0 |
| Invisibility | invisibility | /effect give @p invisibility 60 0 |
| Jump Boost | jump_boost | /effect give @p jump_boost 60 0 |
| Levitation | levitation | /effect give @p levitation 60 0 |
| Luck | luck | /effect give @p luck 60 0 |
| Mining Fatigue | mining_fatigue | /effect give @p mining_fatigue 60 0 |
| Nausea | nausea | /effect give @p nausea 60 0 |
| Night Vision | night_vision | /effect give @p night_vision 60 0 |
| Oozing | oozing | /effect give @p oozing 60 0 |
| Poison | poison | /effect give @p poison 60 0 |
| Raid Omen | raid_omen | /effect give @p raid_omen 60 0 |
| Regeneration | regeneration | /effect give @p regeneration 60 0 |
| Resistance | resistance | /effect give @p resistance 60 0 |
| Saturation | saturation | /effect give @p saturation 60 0 |
| Slow Falling | slow_falling | /effect give @p slow_falling 60 0 |
| Slowness | slowness | /effect give @p slowness 60 0 |
| Speed | speed | /effect give @p speed 60 0 |
| Strength | strength | /effect give @p strength 60 0 |
| Trial Omen | trial_omen | /effect give @p trial_omen 60 0 |
| Bad Luck | unluck | /effect give @p unluck 60 0 |
| Water Breathing | water_breathing | /effect give @p water_breathing 60 0 |
| Weakness | weakness | /effect give @p weakness 60 0 |
| Weaving | weaving | /effect give @p weaving 60 0 |
| Wind Charged | wind_charged | /effect give @p wind_charged 60 0 |
| Wither | wither | /effect give @p wither 60 0 |
Syntax: /effect give <target> <effect> [seconds|infinite] [amplifier] [hide particles]. Amplifier 0 = level I, 1 = level II. To remove an effect use /effect clear @p.
Target selectors
@pnearest player,@aall players,@rrandom player,@sthe one running the command,@eall entities,@nnearest entity.- Filters are added in square brackets:
@e[type=zombie,distance=..10],@a[gamemode=survival,limit=3,sort=random]. ~is a relative position (relative to where you are),^is a position relative to the direction you are looking.
Ready-made command generators: /give, player head, colored sign, tellraw / title. For item codes see Item / Block IDs.
Frequently Asked Questions
How do I enter commands in Minecraft?
Open chat with the T key and type the command starting with / (e.g. /time set day). In a single-player world "Allow Cheats" must be on; on servers you need command permission.
Why doesn't the keepInventory command work?
Gamerule names changed with Minecraft 1.21.11. In the current version you must write /gamerule keep_inventory true. The old name (keepInventory) only works in 1.21.10 and earlier.
What's the command to lock the time to daytime?
In the current version, /gamerule advance_time false (formerly doDaylightCycle) stops the day cycle; first set it to day with /time set day.
What are target selectors (@p, @a)?
@p is the nearest player, @a all players, @r a random player, @s the one running the command, @e all entities, @n the nearest entity.
Other Minecraft Server Tools
Is your server ready? Add your server to the list, collect votes and automatically reward your players. All tools →