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.

Important: With Minecraft 1.21.11 the gamerule names changed (e.g. 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

CommandWhat does it do?Sample
Players and Items
/giveGives an item to the player. For enchanted or named items use the /give Generator./give @p diamond_sword 1
/clearClears the player's inventory (or a specific item)./clear @p dirt
/enchantApplies 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
/effectGives or removes an effect. You can write infinite instead of a duration./effect give @p speed infinite 1 true
/gamemodeChanges the game mode: survival, creative, adventure, spectator./gamemode creative @p
/itemReplaces or modifies an item in an inventory slot./item replace entity @p armor.head with diamond_helmet
/attributeChanges a player's attributes such as health, speed and size./attribute @p minecraft:scale base set 1.5
/recipeAdds or removes recipes in the recipe book./recipe give @p *
/advancementGrants 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
/spawnpointSets the player's spawn point./spawnpoint @p ~ ~ ~
/setworldspawnSets the world's spawn point./setworldspawn 0 70 0
/locateFinds the nearest structure, biome or POI./locate structure minecraft:village_plains
/worldborderSets the world border./worldborder set 10000
/timeSets the time: day, night, noon, midnight or a tick value./time set day
/weatherChanges the weather: clear, rain, thunder./weather clear
/difficultyChanges the difficulty: peaceful, easy, normal, hard./difficulty hard
/gameruleChanges a game rule (table below). Since 1.21.11 the names are snake_case./gamerule keep_inventory true
/seedShows the world's seed./seed
/tickFreezes, speeds up or steps the game speed./tick rate 40
Blocks and Structures
/setblockChanges a single block./setblock ~ ~-1 ~ diamond_block
/fillFills an area with a block (up to 32,768 blocks, can be raised with a gamerule)./fill ~-5 ~ ~-5 ~5 ~ ~5 stone
/cloneCopies an area to another place./clone 0 64 0 10 70 10 100 64 100
/placePlaces a structure, tree or jigsaw piece./place structure minecraft:village_plains
/fillbiomeChanges the biome of an area./fillbiome ~-10 ~-10 ~-10 ~10 ~10 ~10 minecraft:cherry_grove
Entity
/summonSpawns a mob or entity./summon zombie ~ ~ ~ {NoAI:1b}
/killKills entities. Use @e[type=item] to delete items on the ground./kill @e[type=item]
/damageDeals a specific type of damage to an entity./damage @p 5 minecraft:magic
/rideMounts or dismounts an entity onto another./ride @p mount @e[type=horse,limit=1,sort=nearest]
/dataReads 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
/tellrawSends a colored, clickable chat message./tellraw @a {text:"Merhaba",color:"gold"}
/titleShows a large title, subtitle or action bar in the middle of the screen./title @a title {text:"Hoş geldin!",color:"aqua"}
/saySends 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
/meSends an action message./me dans ediyor
Server Administration
/op, /deopGrants / revokes operator status. Using LuckPerms for permissions is safer./op Steve
/ban, /ban-ip, /pardonBans and unbans a player or an IP./ban Steve Hile kullanımı
/kickKicks a player from the server./kick Steve Küfür
/whitelistTurns on the whitelist, adds / removes players./whitelist add Steve
/listLists the online players./list uuids
/save-all, /stopSaves 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
/executeRuns the command as another player, at a position or under a condition./execute as @a at @s run setblock ~ ~-1 ~ gold_block
/function, /reloadRuns a datapack function / reloads datapacks./function ornek:baslat
/scoreboard, /teamScoreboard 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 nameDefaultDescription
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

EffectCodeCommand
Absorptionabsorption/effect give @p absorption 60 0
Bad Omenbad_omen/effect give @p bad_omen 60 0
Blindnessblindness/effect give @p blindness 60 0
Breath of the Nautilusbreath_of_the_nautilus/effect give @p breath_of_the_nautilus 60 0
Conduit Powerconduit_power/effect give @p conduit_power 60 0
Darknessdarkness/effect give @p darkness 60 0
Dolphin's Gracedolphins_grace/effect give @p dolphins_grace 60 0
Fire Resistancefire_resistance/effect give @p fire_resistance 60 0
Glowingglowing/effect give @p glowing 60 0
Hastehaste/effect give @p haste 60 0
Health Boosthealth_boost/effect give @p health_boost 60 0
Hero of the Villagehero_of_the_village/effect give @p hero_of_the_village 60 0
Hungerhunger/effect give @p hunger 60 0
Infestedinfested/effect give @p infested 60 0
Instant Damageinstant_damage/effect give @p instant_damage 60 0
Instant Healthinstant_health/effect give @p instant_health 60 0
Invisibilityinvisibility/effect give @p invisibility 60 0
Jump Boostjump_boost/effect give @p jump_boost 60 0
Levitationlevitation/effect give @p levitation 60 0
Luckluck/effect give @p luck 60 0
Mining Fatiguemining_fatigue/effect give @p mining_fatigue 60 0
Nauseanausea/effect give @p nausea 60 0
Night Visionnight_vision/effect give @p night_vision 60 0
Oozingoozing/effect give @p oozing 60 0
Poisonpoison/effect give @p poison 60 0
Raid Omenraid_omen/effect give @p raid_omen 60 0
Regenerationregeneration/effect give @p regeneration 60 0
Resistanceresistance/effect give @p resistance 60 0
Saturationsaturation/effect give @p saturation 60 0
Slow Fallingslow_falling/effect give @p slow_falling 60 0
Slownessslowness/effect give @p slowness 60 0
Speedspeed/effect give @p speed 60 0
Strengthstrength/effect give @p strength 60 0
Trial Omentrial_omen/effect give @p trial_omen 60 0
Bad Luckunluck/effect give @p unluck 60 0
Water Breathingwater_breathing/effect give @p water_breathing 60 0
Weaknessweakness/effect give @p weakness 60 0
Weavingweaving/effect give @p weaving 60 0
Wind Chargedwind_charged/effect give @p wind_charged 60 0
Witherwither/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

  • @p nearest player, @a all players, @r random player, @s the one running the command, @e all entities, @n nearest 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 →