OmniGame logoOmniGame

Minecraft Commands

43 essential commands with full syntax, examples and OP requirements — for Java and Bedrock.

/advancement

Grants or revokes advancements and their individual criteria for the specified players. `everything` affects all loaded advancements. `only` targets a single advancement (and optionally one criterion within it). `from` targets an advancement and all its descendants. `through` targets an advancement plus all ancestors and descendants. `until` targets an advancement and all ancestors up to the root.

/attribute

Reads or modifies the base value of an entity attribute, or manages transient attribute modifiers that are applied on top of the base value.

/clear

Removes items from player inventories (including hotbar, armor slots, offhand, and crafting grid). If maxCount is 0, counts matching items without removing them. If no item is specified, clears the entire inventory.

/clone

Copies a rectangular region of blocks from one location (optionally in another dimension) to a destination. replace clones all blocks; masked skips air blocks; filtered clones only blocks matching the given block predicate. force allows the destination to overlap the source; move additionally replaces the source region with air; normal (default) requires no overlap. strict suppresses block-updates during placement (Java 1.21.5+).

/damage

Inflicts a specified amount of damage of a given damage type on the target entity. The optional source position or entity affects knockback direction and death messages.

/data

Reads, writes, and modifies NBT data on block entities, living entities, and command storage namespaces. `get` prints or returns a value scaled by a float, `merge` deep-merges a compound, `remove` deletes a path, and `modify` performs list/compound operations (set, append, prepend, insert, merge) from another NBT source or a literal value.

/difficulty

Sets the world difficulty. Omitting the argument in Java Edition queries the current difficulty. Difficulty affects mob damage, spawning rates, hunger depletion, and other survival mechanics.

/effect

Applies or removes status effects on players and other entities. 'give' adds an effect for a specified duration (or infinitely); 'clear' removes a specific effect or all effects from the target.

/enchant

Adds an enchantment to the item currently held in the main hand of one or more targets. Respects the same level caps and incompatibility rules as an anvil. Level defaults to 1 if not specified.

/execute

Executes another command with a modified context (executor, position, dimension, rotation, anchor). Fourteen subcommand types can be chained before the terminal `run` subcommand, or used alone as condition checks. Java-exclusive features include `store`, `on`, `summon`, `if function`, `if items`, `if dimension`, and `if biome`.

/fill

Fills a 3D rectangular region (up to 32,768 blocks) with the specified block. destroy drops existing blocks; hollow fills only the outer shell and clears the interior with air; keep only fills air blocks; outline fills only the outer shell leaving the interior intact; replace (optionally filtered to a specific block type) silently overwrites; strict fills without triggering block-updates or shape-updates (Java 1.21.5+).

/fillbiome

Changes the biome in the rectangular volume defined by two corner coordinates to the specified biome. Because biomes are stored in 4×4×4 block cells, the command snaps to cell boundaries and affects all cells overlapping the selection. Only changes the biome tag; does not alter blocks or entities.

/forceload

Forces specified chunks (identified by any block column coordinates within them) to remain loaded at all times, regardless of player proximity. This keeps redstone, farms, and other mechanisms running when no player is nearby. query lists all currently force-loaded chunks or reports whether a specific chunk is force-loaded.

/function

Runs all commands in a .mcfunction file (or all functions in a function tag when prefixed with `#`). Since 1.20.2, supports macro functions: if the file contains `$`-prefixed macro lines, a compound NBT argument can be passed either as a literal or read from a data source, substituting `$(variable)` placeholders at runtime.

/gamemode

Sets the game mode of one or more players. Accepted values are survival, creative, adventure, and spectator. If no target is specified, applies to the command executor.

/gamerule

Queries or changes a game rule. Boolean rules accept true/false; integer rules accept a non-negative integer. Omitting the value prints the current value of the rule. Rules cover gameplay mechanics including mob spawning, item drops, day-night cycle, fire spread, PvP, and more.

/give

Gives one or more items directly to one or more players' inventories. If the inventory is full, the items are dropped as entities at the player's location. Since Java 1.20.5, items use the component system (bracket notation) instead of legacy NBT tags.

/kill

Instantly kills one or more entities. If no target is specified, kills the command executor. Bypasses all protective gear, armor, enchantments, and status effects. Affected entities drop loot normally and produce death messages.

/locate

Finds and displays the coordinates of the nearest structure, biome, or point-of-interest (POI) of the specified type relative to the executor's current position. Supports resource location IDs and tags (prefixed with #). Does not generate new chunks — only finds already-generated or to-be-generated content along explored terrain.

/loot

Drops or distributes items generated by a loot table into the world, an inventory, or a container. Destinations control where items go; sources control what loot table governs the drops, optionally simulating fishing, entity death, or block mining (including tool enchantment effects).

/particle

Spawns particle effects at a specified location. The delta values define a bounding box offset for random particle spread, speed controls particle velocity, and count sets how many particles appear.

/place

Places a configured feature, jigsaw structure, named structure, or structure template NBT file at a specified position. `feature` uses configured feature registry entries, `jigsaw` runs the jigsaw structure assembly algorithm, `structure` places a full named structure, and `template` places a raw .nbt structure file with optional rotation, mirroring, integrity, and seed.

/playsound

Plays a specified sound event to targeted players from a given position, at a given volume and pitch. The source determines which in-game audio channel (and thus which volume slider) controls the sound.

/random

Generates a random integer within a range, or resets a named random sequence with a specific seed. `value` shows the result only to the command executor; `roll` broadcasts the result to all players. Named sequences (`<sequence>`) are deterministic when seeded and persist across reloads, enabling reproducible randomness in datapacks. `reset *` resets all sequences.

/recipe

Grants or revokes one or all crafting recipes from the specified players. Use `*` to affect all recipes. Particularly important when the `doLimitedCrafting` gamerule is enabled, as players can only craft recipes they have been granted.

/ride

Makes the specified entity (passenger/rider) mount or dismount a vehicle entity. Introduced in Java Edition 1.21.2 (24w33a snapshot).

/schedule

Queues a function or function tag to be executed after a specified delay from the current game tick. `append` allows multiple schedules for the same function to stack; `replace` (default) overwrites the existing pending schedule. `clear` cancels a pending schedule.

/scoreboard

Creates and manages scoreboard objectives (named counters tracked per entity) and manipulates player/entity scores within those objectives. Supports arithmetic operations, display slots, custom number formatting (since 1.20.3), and criteria like `dummy`, `health`, `playerKillCount`, `deathCount`, etc.

/seed

Displays the world seed (a 64-bit integer) in the chat. Useful for sharing or recreating world generation.

/setblock

Places a single block at the specified coordinates, replacing whatever is currently there. The optional mode controls how the existing block is handled: destroy drops the old block and its items; keep only places the block if the target is air; replace (default) silently removes the old block; strict places the block without triggering block-updates or shape-updates (added in Java 1.21.5).

/setworldspawn

Sets the global world spawn point that all players respawn at (and to which compasses point) when no individual spawnpoint is set. The optional angle sets the yaw direction players face upon spawning (-180 = north, -90 = east, 0 = south, 90 = west). Defaults to the executor's current position and facing direction if omitted.

/spawnpoint

Sets the individual respawn point for one or more players. When a targeted player dies, they respawn at this location rather than the world spawn. The optional angle parameter sets the yaw direction faced on respawn. Omitting all arguments sets the spawn to the executor's current position.

/spreadplayers

Teleports entities to random surface locations within a square region centered on the given 2D coordinate, with a minimum separation between them. The 'under' variant places entities under a maximum Y height.

/summon

Summons an entity at the specified position (or the executor's position if omitted). An optional SNBT compound tag can set initial NBT data on the spawned entity.

/tag

Adds, removes, or lists scoreboard tags on entities. Tags can then be used in target selectors with the tag= argument to filter entities.

/team

Creates, manages, and modifies scoreboard teams. Teams control friendly fire, name-tag visibility, death messages, collision rules, and text prefix/suffix for members.

/tellraw

Sends a JSON text component message to one or more players in the chat (or game log). Supports rich formatting, click events, hover events, and embedded score/selector/NBT values.

/time

Queries or modifies the in-game daylight cycle clock. 'add' shifts time forward by the given amount; 'set' jumps directly to a value or named marker; 'query' returns tick counts; 'pause'/'resume' freeze or unfreeze the clock.

/title

Displays large text titles, subtitles, or action bar messages on players' screens, with configurable fade-in, display, and fade-out timing.

/tp

Teleports one or more entities (players, mobs, items, etc.) to a specified location or to another entity. /tp is an alias for /teleport. Can generate previously unloaded chunks at the destination.

/weather

Sets the weather in the current dimension. Duration is optional; if omitted, a random duration is chosen (clear: 10–150 min, rain: 10–20 min, thunder: 3–13 min). Duration can be specified in ticks, seconds (s), or days (d).

/worldborder

Manages the world border: its size, center, damage buffer, and visual warning. set/add resize the border, optionally over a time period in seconds for smooth animation. center repositions the border's origin. damage controls how quickly players outside the border take damage and the buffer zone size. warning tints the screen red when the player is near the border.

/xp

Adds, sets, or queries player experience points or levels. /xp is an alias for /experience. Negative amounts in 'add' mode remove experience. 'query' returns the current level or raw point total.