Compartir

Compartir

¡Ya tenemos Twitter! Síguenos para recibir información sobre Minecraft y la wiki. 

Comandos

De Minecraft Wiki
Saltar a: navegación, buscar
Iconolupa.png
Este artículo necesita una revisión de contenido y formato
Recuerda usar la guía de estilos en los artículos.


ImagenTraducir.png
Se necesita traducir el contenido de este artículo.
Este artículo contiene texto en inglés. Puedes ayudar traduciéndolo


Los comandos son unas funciones avanzadas que se activan al escribir determinadas cadenas de caracteres.

En un cliente normal de Minecraft, los comandos se introducen a través de la ventana de chat, que aparece cuando se pulsa la tecla T (por defecto) o la tecla /. Al utilizar la tecla /, se introduce automáticamente en la barra con la que comienzan todos los comandos, convirtiéndolo en un atajo muy útil. Pulsar Tab ↹ cuando se está introduciendo un comando muestra los posibles comandos o argumentos.

Los comandos también se pueden introducir en la consola de un servidor multijugador, pero en este caso no tienen el prefijo /. Los comandos en [[Bloque de comandos|bloques de comandos}} pueden tener la barra inicial, pero no es necesario. Los comandos en un bloque de comandos también necesitan un argumento opcional, normalmente el nombre de un jugador.

La mayoría de comandos solo están disponibles en las siguientes situaciones:

Algunos comandos de jugador también están habilitados en el modo un jugador aunque las trampas no estén habilitadas.

Nota: En modo un jugador, los mundos en los que las trampas no fueron habilitadas en la creación del mundo, pueden ser activados temporalmente al abrir la sesión de juego a un juego LAN (Esc -> "Abrir a LAN", después "Permitir trampas" y "Comenzar mundo LAN"). No es necesario estar en una LAN o tener a otros jugadores en el mundo. Esto no es un cambio irreversible, pero permite utilizar los comandos hasta que el jugador salga del juego, y los cambios realizados con comandos (objetos creados, etc.) se guardarán con el mundo. Esto se puede hacer cada vez que empezas a jugar en el mundo de nuevo. Nótese que al abrir un juego en LAN se desactiva la pausa del juego, por lo que es recomendable buscar un sitio seguro antes. Cabe recordar que se puede desactivar el modo LAN recargando el mundo.

Utilización[editar]

Leyenda[editar]

En las tablas siguientes, el texto de los comandos está formateado de esta manera:

Si ves... Entonces
<corchetes angulares> Este es un argumento necesario.
[corchetes cuadrados] Este es un argumento opcional.
cursiva Reemplaza esto con un valor apropiado.
texto normal Introduce esto literalmente, exactamente como aparece.
x|y Elige una de las opciones mostradas.

Las opciones disponibles se muestran separadas con barras verticales: |

elipsis … El argumento consiste en varias palabras separadas por espacios.

Selectores de objetivos[editar]

En lugar de nombres de jugadores, es posible seleccionar múltiples objetivos a la vez, utilizando las siguientes variables:

Variable Función
@p Jugador más próximo
@r Jugador aleatorio
@a Todos los jugadores
@e Todas las entidades

Argumentos para el selector de objetivos[editar]

Tras seleccionar un objetivo (@a, @p, @r, or @e), se pueden utilizar opcionalmente argumentos de la siguiente manera: @<selector>[<argumento>=<valor>,<argumento>=<valor>,...]
NOTA: Asegúrate de no agregar espacios o puntos entre los corchetes.

Argumento Función
x Coordenada X para el área de búsqueda, siendo el centro de la selección radial y la esquina inicial (inferior noroeste) de la selección cúbica. Nótese que debe ser un valor entero.
y Coordenada Y para el área de búsqueda, siendo el centro de la selección radial y la esquina inicial (inferior noroeste) de la selección cúbica. Nótese que debe ser un valor entero.
z Coordenada Z para el área de búsqueda, siendo el centro de la selección radial y la esquina inicial (inferior noroeste) de la selección cúbica. Nótese que debe ser un valor entero.
dx Compensación de la coordenada X (un offset) de la esquina opuesta para definir un área rectangular de búsqueda. Nótese que no puede ser un valor negativo.
dy Compensación de la coordenada Y (un offset) de la esquina opuesta para definir un área rectangular de búsqueda. Nótese que no puede ser un valor negativo.
dz Compensación de la coordenada Z (un offset) de la esquina opuesta para definir un área rectangular de búsqueda. Nótese que no puede ser un valor negativo.
r Radio máximo de búsqueda.
rm Radio mínimo de búsqueda.
rx Rotación máxima del eje X.
rxm Rotación mínima del eje X.
ry Rotación máxima del eje Y.
rym Rotación mínima del eje Y.
m El modo de juego de un jugador. -1=Todos, 0=Supervivencia, 1=Creativo, 2=Aventura, 3=Espectador
c Número de objetivos a especificar. Si es negativo, utliza objetivos desde el final al principio de la lista.
l Nivel de experiencia máximo de los jugadores.
lm Nivel de experiencia mínimo de los jugadores.
score_nombre Para el objetivo "nombre", la máxima puntuación que tiene este jugador.
score_nombre_min Para el objetivo "nombre", la mínima puntuación que tiene este jugador.
team Comprueba si el jugador está en un equipo específico. Al insertar un '!' antes del nombre del equipo comprueba solo los jugadores que no estén en dicho equipo. No añadir el nombre de ningún equipo permite comprobar a todos los jugadores que no tengan equipo.
name Comprueba si hay jugadores o entidades con este nombre. Usando =! en lugar de = comprueba solo si hay jugadores/entidades que no tienen este nombre. (Ejemplo: name=!Notch)
type Comprueba si hay entidades con este entity type. (Ejemplo: type=EntityHorse) Esto también puede ser utilizado con =! (descrito arriba).

Ejemplo: @p[x=1,y=30,z=26,r=10,rm=2,m=1,c=3,l=25,lm=3,score_Kills_min=1,score_Deaths=2,team=Red] Explicación:

@p solo especifica al jugador más cercano.

x=1,y=30,z=26 establece el centro del radio a x: 1, y: 30 y z: 26.

r=10 establece el radio de búsqueda (máximo) a 10.

rm=2 establece el radio de búsqueda mínimo a 2.

m=1 especifica solo a jugadores con modo de juego 1 (creativo).

c=3 especifica a los tres primeros jugadores de la lista (nota: para @p, 'c' es por defecto 1, no como @e y @a).

l=25 especifica a todos los jugadores con nivel de experiencia de 25 o menos.

lm=3 especifica a todos los jugadores con nivel de experiencia de 3 o más.

score_Kills_min=1 especifica a todos los jugadores con al menos 1 "Kills" (puntuación).

score_Deaths=2 especifica a todos los jugadores con al menos 2 "Deaths" (puntuación).

team=Red especifica a todos los jugadores en el equipo "Red".


De forma alternativa, las coordenadas de radio máximo (pero no mínimo!) pueden ser dadas más concisamente siempre y cuando sean los (hasta 4) primeros valores sin argumento. Por ejemplo:

@p[1,30,26,10,rm=2,m=1,c=3,l=25,lm=3,score_Kills_min=1,score_Deaths=2,team=Red]

es idéntico al ejemplo anterior.

Dado que el argumento 'c' utiliza a los jugadores desde el final de una lista primero cuando es negativa, al poner @p[c=-1] se seleccionará al jugador más alejado en lugar del más cercano (con @e[c=-1] se seleccionará a la entidad más alejada).

@e[type=Arrow,r=100,c=-1]

encuentra la flecha más alejada en el radio de búsqueda (100).

Si se especifica r con dx, dy o dz, solo se buscará a las entidades que estén dentro de ambas regiones.

Nótese que dx, dy y dz son offsets de las coordenadas originales x, y y z. No actúan como otro conjunto de coordenadas que permita definir un área cúbica. En otras, palabras, no son las coordenadas de la esquina opuesta del cubo que se quiere definir, sino la distancia desde la x, la y y la z a la esquina opuesta. Por ejemplo, si se quiere definir un cubo desde la esquina: x:50 y:10 z:50 a la otra esquina: x:100 y:20 z:200, se tendrán que escribir los argumentos de la siguiente manera: [x=50,y=10,z=50,dx=50,dy=10,dz=150], y no [x=50,y=10,z=50,dx=100,dy=20,dz=200] porque dx, dy y dz "suman" al área cúbica (50+50=100,10+10=20,50+150=200), no lo definen.

Comandos de jugador[editar]

Estos comandos pueden ser utilizados en la ventada de chat de cualquier jugador que se pueda conectar a un servidor, y también se pueden utilizar en modo un jugador tanto si las trampas están activadas como si no.

Comando Descripción Condiciones[note 1]

help [página|nombre del comando]
? [página|nombre del comando]

Muestra una lista de los comandos disponibles o información detallada sobre el nombre del comando. Nota: los comandos exclusivos para multijugador no aparecen en modo un jugador, incluso aunque se abra un juego LAN.

Se ejecuta con éxito si página es válido o no se especifican argumentos. Técnicamente falla si se especifica nombre del comando, aunque muestre el uso de dicho comando.

me <acción …>

Manda un mensaje narrativo a los otros jugadores de la forma "* Tunombre acción" (p.ej., "* Notch estornuda." o "* Notch explotó." ). Si se utiliza en acción un selector de objetivos que apunte a varios jugadores (p.ej., @a), la lista de nombres se formatea así "nombre1, nombre2, and nombre3", o "nombre1 and nombre2" para dos nombres. Por eso, sin importar el tipo de selector de objetivos que se utilice en acción, este comando solo imprimirá un mensaje.

Todos los selectores de objetivo (p.ej., @p) en acción deben ser evaluados.

tell <jugador> <mensaje privado …>
msg <jugador> <mensaje privado …>
w <jugador> <mensaje privado …>

Se utiliza para mandar un mensaje privado a un jugador en el servidor. Es muy útil cuando necesitas preguntar/decir algo a otro jugador sin que los demás lo vean. Si se utiliza en mensaje privado un selector de objetivos que apunte a varios jugadores (p.ej., @a), la lista de nombres se formatea así "nombre1, nombre2, and nombre3", o "nombre1 and nombre2" para dos nombres. Por eso, sin importar el tipo de selector de objetivos que se utilice en mensaje privado, este comando solo imprimirá un mensaje - sin embargo, un selector en jugador sí permite mandar un mensaje a varias personas.

Todos los selectores de objetivo (p.ej., @p) en mensaje privado deben ser evaluados, y jugador debe estar conectado.

trigger <objetivo> <add|set> <valor>

Se utiliza junto a /tellraw para permitir a jugadores activar sistemas creados por operadores o creadores de mapas. El objetivo debe ser un objetivo habilitado del marcador del criterio "trigger". El valor dado es añadido al valor existente, o convertido en el nuevo valor, dependiendo de si el segundo argumento es add o set. El valor del objetivo es modificado solo para el jugador que utilice el comando.

El comando trigger será añadido en la 1.8 y actualmente solo está disponible en snapshots.

objetivo debe tener el criterio "trigger" y el jugador que ejecuta el comando debe ser capaz de modificar objetivo.

  1. Las condiciones de un comando deben ser cumplidas para que el juego considere que el comando se ha ejecutado con éxito. Esto se usa para determinar una gran variedad de cosas, como por ejemplo la corriente de salida de un comparador conectado a un bloque de comandos. Nótese que no todos los comandos ejecutados correctamente hacen algo, y no todos los comandos fallidos no hacen nada útil.

Comandos solo para operadores[editar]

Estos comandos pueden ser utilizados por operadores desde la consola del servidor y desde la ventana de chat (en este caso los comandos deben ir precedidos de /). Los resultados de estos comandos son transmitidos a todos los operadores online.

Estos comandos también están disponibles en modo un jugador con trampas activadas o para jugadores que hostean un mundo.

Comando Descripción Condiciones

achievement give <nombre_estad> [jugador]

Da a un jugador un logro, y todos los logros previos, o incrementa una puntuación 1 punto. nombre_estad debe utilizar achievement.nombre_logro, donde nombre_logro es un logro válido (véase Marcador o Logros para logros válidos), o stat.nombre_estadistica, donde nombre_estadistica es una estadística válida (véase Marcador para estadísticas válidas). Si no se especifica jugador, el logro o la estadística se le dará al ejecutor del comando.

nombre_estad debe ser un nombre de estadística o logro válido. jugador es obligatorio y no opcional en bloques de comandos y el jugador debe estar online.

blockdata <x> <y> <z> <dataTag>

Edita las etiquetas de datos del bloque en el lugar x, y, z. Para más información sobre las etiquetas de datos, véase la sección Data tags.

El comando blockdataserá añadido en 1.8 y actualmente solo está disponible en snapshots.

dataTag debe ser un argumento válido para el bloque en x, y, z.

clear [jugador] [objeto] [dato] [cantMax] [dataTag]

Limpia el inventario de jugador (que si no se especifica es el jugador que ejecuta el comando) del objeto:dato, con la etiqueta de datos especificada en dataTag. No quita más de maxCount de objetos. Si no se especifican etiquetas opcionales, se borra todo el inventario.

Los argumentos de cantMax y dataTag serán añadidos en 1.8 y actualmente solo están disponibles en snapshots.

Se deben borrar al menos cero objetos, y jugador debe estar conectado. Puede imprimir una señal por un comparador si se borran los objetos correctamente. dato puede ser -1 para borrar sin tener en cuenta el valor de durabilidad, y cantMax puede ser -1 para eliminar todos los stacks del objeto seleccionado.

clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [modo] [modo2]

Clona un área dada. El destino es (x, y, z), donde los bloques son colocados en el lado de las coordenadas positivas.

modo puede ser:

  • replace - (por defecto), el cual copia todos los bloques.
  • masked - el cual copia todos los bloques que no son aire.
  • filtered - que quita todos los bloques innecesarios y los reemplaza con aire.

modo2 puede ser:

  • move - reemplaza los bloques clonados con aire (en filtered se deben incluir qué bloques deben ser filtrados).
  • force - hace que el comando se ejecute aún si el área del que deben ser clonados los bloques se superpone al área donde deben ser clonados (en filtered se deben incluir qué bloques deben ser filtrados).
  • normal - (en filtered se deben incluir qué bloques deben ser filtrados).

El comando clone será añadido en 1.8 y actualmente solo está disponible en snapshots.

El área que se clone y el área en el que se clonan los bloques deben ser renderizados, no deben superponerse y deben estar dentro del límite de 32768 bloques (incluyendo bloques de aire)

debug <start|stop>

Starts a new debug profiling session or stops the session currently running. It notifies about potential performance bottlenecks in the console when active and creates a profiler results file in the folder debug when stopped.

Can only stop if a session is running. Cannot be used in a command block.

defaultgamemode <mode>

Sets the default game mode that is shown on the world selection menu. New players that join the world will be put into the default game mode; i.e., if the default game mode is creative, new players will start in creative. This command cannot enable or disable Hardcore mode.

mode must be a valid game mode: survival, creative, adventure, or spectator. The game modes can be abbreviated to "s/c/a/sp" or "0/1/2/3" respectively.

difficulty <new difficulty>

Changes the difficulty for as long as the server is running. If the server is restarted, the difficulty will go back to whatever difficulty is set in server.properties.

new difficulty must be a valid difficulty: peaceful, easy, normal, or hard. The difficulties can be abbreviated to "p/e/n/h" or "0/1/2/3" respectively.

effect <player> <effect> [seconds] [amplifier] [hideParticles]

Gives the targeted player (or entity, via the @e target selector) the specified effect for the specified time (default is 30 seconds). Effects have a limit of 1,000,000 seconds, and the amplifier field has a limit of 255. Effect id's can be found on the potion effects page. Setting seconds to 0 clears this effect. If you put the amplifier to a number of a variably high value, it will not give the desired amplifier. Setting hideParticles to true hides effect particles, if value not given, defaults to false.

If clearing an effect, the player must have this effect. effect must be a valid effect. player must be online.

effect <player> clear

Clears all effects on player (or entity, via the @e target selector).

At least one effect must be removed, and player must be online.

enchant <player> <enchantment ID> [level]

Enchants the item that the player is currently holding, according to enchantment ID. Note that this works within the normal limitations of enchanting items. Enchantments can only be applied to items which can normally receive that specific enchantment. Enchantment levels can not be above the normal highest achievable for the selected enchantment. Conflicting or overpowering enchantment combinations usually prevented are also prevented with this command.

The enchantment ID must be valid, the level must be valid for this enchantment (unless the held item is also invalid), the held item must be able to accept this enchantment, the held item cannot have conflicting enchantments, and player must be online.

execute <entity> <x> <y> <z> <command …>

Runs command as though it were executed by entity, and as though entity were located at x, y, z. The command will be run as though the entity has operator-level permission.

The execute command will be added in 1.8 and is currently available only in the snapshots.

entity must resolve to one or more valid entities (including players, who must be online if specified by name). x and z must be within the range -30,000,000 to 30,000,000 (inclusive). command must execute successfully.

execute <entity> <x> <y> <z> detect <x2> <y2> <z2> <block> <data> <command …>

Runs command as though it were executed by entity, and as though entity were located at x, y, z. It will only run command if the specified block is located at x2, y2, z2, starting from x, y, z for relative coordinates. The command will be run as though the entity has operator-level permission.

The execute command will be added in 1.8 and is currently available only in the snapshots.

entity must resolve to one or more valid entities (including players, who must be online if specified by name). x and z must be within the range -30,000,000 to 30,000,000 (inclusive). The specified block must be found at x2, y2, z2. command must execute successfully.

fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> [dataValue] [oldBlockHandling] [dataTag]

Fills the given area with a block specified by TileName, dataValue, and dataTag. oldBlockHandling mode is either destroy, keep, hollow, or outline.

  • replace - Destroys any blocks within the target location and replaces them with "TileName", without dropping item entities.
  • destroy - Destroys any blocks within the target location, dropping them as item entities, and replacing them with "TileName".
  • keep - Only replaces air blocks found in the fill area with "TileName".
  • hollow - Wraps only the outer layer of the fill area, creating a square box of "TileName", and replacing all blocks inside of the box area with air. Containers inside of the box will drop their contents, but not their block.
  • outline - Wraps only the outer layer of the fill area, creating a square box of "TileName". (Leaves all blocks leftover inside the box area alone and doesn't destroy them)

The fill command will be added in 1.8 and is currently available only in the snapshots.

A starting point and an end point must be input followed by a block. Your feet (y-value), will be the point where blocks will begin to fill. Chunks must be loaded and can only fill within a 32768 block limit (including air blocks)

fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> <dataValue> replace [replaceTileName] [replaceDataValue]

Replaces all blocks matching replaceTileName and replaceDataValue in a given area with TileName and dataValue. If replaceTileName and replaceDataValue are not given, any block will be replaced. Note that the replace operation does not support a dataTag argument if replaceTileName is given (use above syntax instead to replace any block and have dataTag support).

The fill command will be added in 1.8 and is currently available only in the snapshots.

A starting point and an end point must be input followed by a block. Your feet (y-value), will be the point where blocks will begin to fill. Chunks must be loaded and can only fill within a 32768 block limit (including air blocks)

gamemode <mode> [player]

Changes the game mode for player. If no player is given, it will set your own gamemode.

mode must be a valid game mode: survival, creative, adventure, or spectator. The game modes can be abbreviated to "s/c/a/sp" or "0/1/2/3" respectively.

player must currently be online. player is not optional for command blocks.

gamerule <rule name>
gamerule <rule name> [value]

Activates or deactivates the rule name. If value is not given, displays the current status of rule name.

Available rules are:

  • commandBlockOutput - Whether command blocks should notify admins when they perform commands
  • doDaylightCycle - Whether time progresses
  • doFireTick - Whether fire should spread and naturally extinguish
  • doMobLoot - Whether mobs should drop items
  • doMobSpawning - Whether mobs should naturally spawn
  • doTileDrops - Whether blocks should have drops
  • keepInventory - Whether the player should keep items in their inventory after death
  • mobGriefing - Whether Creepers, Endermen, Ghasts, Withers and Villagers should be able to change blocks or zombies, skeletons, and Zombie Pigmen can pick up items
  • naturalRegeneration - Whether the player can regenerate health naturally if their hunger is full enough

The following rules will be added in 1.8 and are currently available only in the snapshots:

  • logAdminCommands - Whether to log admin commands to server log
  • randomTickSpeed - How often a random tick occurs, such as plant growth, leaf decay, etc. Can be 0 to disable random updates
  • sendCommandFeedback - Whether the feedback from commands executed by a player should show up in chat
  • showDeathMessages - Whether a message appears in chat when a player dies

Valid value for all gamerules are true or false, except randomTickSpeed which can be any non-negative integer.

Succeeds in all cases - even absent/invalid rule name or a property besides true or false.

give <player> <item> [amount] [data] [dataTag]

Spawns amount (defaults to 1) of the item defined by item with the specified data (defaults to 0) at the location of player, using dataTag for the "tag" NBT tag. For example typing /give John planks 30 1 {display:{Lore:["Wooden planks"]}} will give a player called John 30 blocks of Spruce Wood Planks with Lore that says "Wooden planks".

item must be a valid ID or item name, amount must be from 0 to 64, and player must be online.

kill [player|entity]

Inflicts 1000 (Heart.png × 500) void damage to the target, killing the target instantly even if in Creative mode (a high-level Resistance effect cannot protect the player either). The text "Ouch! That looks like it hurt." will be displayed after executing. Useful when lost, stuck, or to restore health and hunger (assuming you can get your items back easily or the keepInventory gamerule is set to "true"). If player|entity is not specified, the player running the command will be killed.

The player|entity argument will be added in 1.8 and is currently available only in the snapshots.

player|entity is not optional in command blocks.

particle <name> <x> <y> <z> <xd> <yd> <zd> <speed> [count] [player|entity]

Spawns particles in a given area or at a given player/entity.

The particle command will be added in 1.8 and is currently available only in the snapshots.

name must be a valid particle name. x and z must be within the range -30,000,000 to 30,000,000 (inclusive). player|entity is not optional in command blocks.

playsound <sound> <player> [x] [y] [z] [volume] [pitch] [minimumVolume]

Plays the selected sound to the selected player. The value of sound is any event defined in sounds.json (for example, mob.pig.say). Note that Resource Packs may add their own events to sounds.json; the command will successfully play these. File names are not used by this command; it strictly uses the events defined in sounds.json (which may not even be similar to the original file names and paths), and thus a resource pack adding new sound files must define events for them (this is not necessary when replacing old sounds which are already in defined events). If an event contains multiple sounds, this command will select randomly between them (chances are modified by each sound's "weight" property), just as the game normally would. For example, "mob.pig.say" will play one of several pig sounds at random, because the event has multiple sounds associated with it.

The coordinates x, y, and z are the coordinates to play the sound from. If prefixed with "~", they will be relative to the player's current location. Note that "~" is shorthand for "~0", and thus "~ ~ ~" can be used as a substitute for the player's current location.

The volume argument controls the distance from which a sound may be heard. At values less than 1.0, the sound will be quieter and have a smaller sphere within which it may be heard. At values greater than 1.0, the sound will not actually grow louder, but its audible range (a 16-block radius at 1.0) will be multiplied by volume. There will always be a gradual falloff to silence based on distance from the center of the sphere.

The minimumVolume argument controls the volume of the sound for players outside its normal audible sphere. If the player is outside the normal sphere, the sound will instead be centered some short distance (<4 blocks) from the player, and minimumVolume will determine its volume.

The pitch argument alters both the pitch and the duration of the sound (which means that it's actually changing its speed).

player must be online, volume must be at least 0.0, pitch must be between 0.0 and 2.0 (inclusive), minimumVolume must be between 0.0 and 1.0 (inclusive), and the player must be able to hear the sound from where it is played.

publish

Opens your single-player game for LAN friends to join. This command appears in the singleplayer cheats.

Cannot be used in a command block.

replaceitem block [x] [y] [z] <slot> <item> [amount] [data] [dataTag]

Replaces an item in a certain slot of a container block with another item.

The slot argument must be slot.container.* (where * is replaced with a number for the correct inventory slot).

The replaceitem command will be added in 1.8 and is currently available only in the snapshots.

The block must be a container block and the slot and item arguments must be correct.

replaceitem entity <selector> <slot> <item> [amount] [data] [dataTag]

Replaces an item in a certain slot of an entity (player or mob) with another item.

The slot argument must be one of (where * is replaced with a number for the correct inventory slot):

  • slot.armor.feet|legs|chest|head
  • slot.enderchest.*
  • slot.horse.armor|chest.*|saddle
  • slot.hotbar.*
  • slot.inventory.*
  • slot.villager.*
  • slot.weapon

slot.equipment.* is not currently a valid argument, but mob equipment can be replaced with slot.armor.* or slot.weapon (listed above).

The replaceitem command will be added in 1.8 and is currently available only in the snapshots.

The player must be online and the slot and item arguments must be correct.

say <message …>

Broadcasts message to all players on the server. If a multi-person target selector (e.g., @a) is used, the list of names is formatted as "name1, name2, and name3", or "name1 and name2" for two names. Therefore, regardless of any target selectors which are used, this command will only output once.

All target selectors (e.g., @p) in the message must evaluate.

scoreboard <objectives|players|teams>

See Scoreboard for more information. Scoreboard-specific commands.

Main Article

seed

Displays the seed. This command can always be used in single-player mode, regardless of whether cheats are enabled or not.

Always succeeds (if user is a command block, player in singleplayer, or server op).

setblock <x> <y> <z> <TileName> [dataValue] [oldBlockHandling] [dataTag]

Places the block in the x, y and z coordinates specified.

TileName must exist, dataValue must exist if specified, oldBlockHandling must be either replace, keep or destroy if specified and dataTag must evaluate if specified.

setworldspawn
setworldspawn <x> <y> <z>

Sets the world's spawn to the specified coordinates. The worldspawn is where you first spawn and where you respawn if you die and your bed is missing or obstructed. If no coordinates are specified, the world spawn will be set to the executor's current location. Note that a 10 chunk (160 block) radius around the worldspawn is kept loaded at all times. However this only applies if the chunks are already loaded when it is set. Setting it to a place where no player is will NOT cause the area to load. Also compasses (which in minecraft point to the worldspawn rather than north) will not update to the change until you reload the world.

x, y, and z must be within the range -30,000,000 to 30,000,000 (inclusive). x, y, and z are not optional in command blocks.

spawnpoint
spawnpoint <player>
spawnpoint <player> <x> <y> <z>

Sets the spawnpoint of that player to that position, or to the current position if x y and z are not specified. player is optional if x y z are not specified; will set the spawnpoint of the user to their current location. NOTE: Spawnpoint coordinates must be specified in integers. No decimals.

Sleeping in a bed will also set a spawn point where the bed is, but you can only sleep in beds at night or when it rains.

player must be online, and x, y, and z must be within the range -30,000,000 to 30,000,000 (inclusive).

spreadplayers <x> <z> <spreadDistance> <maxRange> <respectTeams> <player …>

This command allows players to spread out over a long or short distance.

x and z mark the center of the area across which players are to be spread.

spreadDistance is the rough minimum distance players will be spread apart.

maxRange is the maximum distance from x, z where players will be put. Note that this distance is not a circular radius; it represents the maximum distance on either coordinate (thus forming a box ranging from x-maxRange to x+maxRange and z-maxRange to z+maxRange).

respectTeams may be true or false, and represents whether players should be moved individually or teams should be kept together.

player is the list of players to spread. Names are separated by spaces.

x and z must be within the range -30,000,000 to 30,000,000 (exclusive), spreadDistance must be at least 0, maxRange must be at least 1.0 greater than spreadDistance, and there must not be too many players to fit within the area. If maxRange is larger than 30,000,000, the command can fail with even one player if it attempts to place them outside the world boundary). Players do not spread to lava.

summon <EntityName> [x] [y] [z] [dataTag]

Spawns an entity. For example, to create a charged creeper named Powered Creeper at the player's current location:

/summon Creeper ~ ~ ~ {powered:1,CustomName:Powered Creeper}

x and z must fall within the range -30,000,000 to 30,000,000 (inclusive), and y must be at least 0. If coordinates aren't specified the entity will spawn at the player's location (or inside a command block if the command was executed by one).

tellraw <player> <raw json message>

Sends a JSON message to specified player(s), allowing formatting and clickable actions in chat text. Color defaults to white and all formatting (bold, italic, etc.) defaults to false.

player must be online, and the message text must be correctly coded in JSON.

testfor <player> [dataTag]

Used to test whether the given player (or entity, by the @e target selector) could be located, and whether it has all tags specified by dataTag. A redstone comparator as output from a command block with this command will indicate the number of players/entities matched by it. For example, "testfor @a[r=3]" will output the number of players within 3 meters of the command block, and added in snapshot 14w02a, "testfor @e[type=Arrow,r=3] {inGround:1b}" will output the number of arrows stuck in a block within 3 meters.

player and dataTag must be valid and match some entity if specified.

testforblock <x> <y> <z> <TileName> [dataValue] [dataTag]

Used to test whether a particular block is in the x, y and z coordinates specified. Datatags will not work unless a special syntax is used to specify what type of NBT tag is used (s for Short, b for Byte, l for Long, f for Float and d for Double). Also all relevant tags must be included even if they are unused (e.g.: Chest contents must include Slot, id, Damage, and Count.)

TileName must exist, dataValue must exist if specified, and dataTag must evaluate if specified.

testforblocks <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [mode]

Compares the blocks at two locations in cuboid regions. (x1, y1, z1) and (x2, y2, z2) specifies the lowest and highest coordinate corners of the source region (the block pattern to check for), and (x, y, z) specifies the lowest coordinate corner of the destination region (the region to be checked).

mode is masked (air blocks in the source region will match any block in the destination region) or all (all blocks must match exactly, even air).

The testforblocks command will be added in 1.8 and is currently available only in the snapshots.

x1, z1, x2, z2, x, and z must fall within the range -29,999,984 to 29,999,984 (inclusive). y must be 0 to 189, and y2 must be 0 to 187.

time set <value>

Sets the world time. value is an integer between 0 and 24000, inclusive, where 0 is dawn, 6000 midday, 12000 dusk and 18000 midnight. value can be greater than 24000; in this case, the time of day wraps around, but the moon's phase is advanced. However, setting the time "backward" (earlier than the current time) does not change the moon. "time set day" sets the time to 1000, and "time set night" sets the time to 13000.

value must be 0 or positive, or day or night.

time add <value>

Increments the world time, as above.

value must be 0 or positive. The daytime wraps, and the moon's phase advances; adding 24000 will advance the moon's phase by one day.

title <player> clear

Removes title from player.

The title command will be added in 1.8 and is currently available only in the snapshots.

player must be a valid online player.

title <player> reset

Resets subtitle, fadeIn time, stay time, and fadeOut time for player.

The title command will be added in 1.8 and is currently available only in the snapshots.

player must be a valid online player.

title <player> subtitle <raw json title>

Sets the subtitle text for player. This is only displayed if a title is on the player's screen at the same time (can be empty).

The title command will be added in 1.8 and is currently available only in the snapshots.

player must be a valid online player. raw json title must be a single word of text (not delimited by curly brackets) or a valid json specification.

title <player> times <fadeIn> <stay> <fadeOut>

Sets the time in game ticks for title (and optional subtitle) to fade in, persist, and fade out, for player.

The title command will be added in 1.8 and is currently available only in the snapshots.

player must be a valid online player.

title <player> title <raw json title>

Sets the title text for player and shows the title (optionally, with prespecified subtitle). Titles are displayed in the middle of your screen.

The title command will be added in 1.8 and is currently available only in the snapshots.

player must be a valid online player. raw json title must be a single word of text (not delimited by curly brackets) or a valid json specification.

toggledownfall

Toggles rain and snow.

Always succeeds.

tp [target player] <destination player>

Teleports target player (or entity, by the @e target selector) to the location of destination player (or entity, by the @e target selector). If no player/entity is specified, it will teleport yourself.

target player is not optional in command blocks. Both players must be online.

tp [target player] <x> <y> <z> [<y-rot> <x-rot>]

Teleports target player (or entity, by the @e target selector – or yourself if no player/entity is specified) to coordinates x,y,z. Can also relatively move the player/entity by adding the ~ character before the coordinate value. For example typing /tp John ~3 64 ~3 will teleport a player called John 3 blocks away from his current x and z, and to y 64. Additionally, y-rot and x-rot may optionally be used to specify the yaw and pitch in degrees - these also accept ~.

The rotation arguments will be added in 1.8 and are currently available only in the snapshots.

x and z must fall within the range -30,000,000 to 30,000,000 (exclusive), and y must be at least 0. target player is not optional in command blocks, and the player must be online.

weather <clear|rain|thunder> [duration in seconds]

Changes the weather for the specified duration.

duration in seconds must be at least 1, and cannot be greater than 1,000,000, and a valid weather condition must be provided.

worldborder add <sizeInBlocks> [timeInSeconds]

Adds blocks to the current size of the world border. Can use negative (-) numbers to subtract the size of the border.

The worldborder command will be added in 1.8 and is currently available only in the snapshots.

Always succeeds even if the worldborder isn't set.

worldborder center <x> <z>

Sets the center of the world border.

The worldborder command will be added in 1.8 and is currently available only in the snapshots.

x and z must fall within the range -30,000,000 to 30,000,000 (exclusive).

worldborder damage amount <damagePerBlock>

Sets the amount of damage inflicted per second per block past the world border buffer (defaults to 0.2). For example, if damagePerBlock is 0.1, a player 5 blocks outside the world border buffer will take 0.5 damage per second (damage less than half a heart might not change the visual health display, but will still accumulate).

The worldborder command will be added in 1.8 and is currently available only in the snapshots.

damagePerBlock must be at least 0.0.

worldborder damage buffer <sizeInBlocks>

Sets the buffer distance outside the world border before damage begins to be inflicted (defaults to 5.0).

The worldborder command will be added in 1.8 and is currently available only in the snapshots.

sizeInBlocks must be at least 0.0.

worldborder set <sizeInBlocks> [timeInSeconds]

Sets the diameter of the world border. sizeInBlocks is the new diameter. timeInSeconds is the number of seconds it should take for the border to move from its previous location to the new location. If timeInSeconds is not specified, the diameter changes immediately.

The worldborder command will be added in 1.8 and is currently available only in the snapshots.

sizeInBlocks must fall within the range 1 to 60,000,000 (inclusive).

worldborder warning distance <blocks>

Sets the distance inside the world border where visual warning of world border proximity begins (defaults to 5).

The worldborder command will be added in 1.8 and is currently available only in the snapshots.

blocks must be at least 0.

worldborder warning time <seconds>

Sets the time before a moving world border intersects the player when visual warning of the world border starts (defaults to 15). For example, if seconds is 5, players will get a visual warning when the moving world border is 5 seconds or less away from passing their position.

The worldborder command will be added in 1.8 and is currently available only in the snapshots.

seconds must be at least 0.

xp <amount> [player]

Gives the specified user the given number of orbs. Maximum is 2,147,483,647 per command. Negative amounts may not be used to remove experience points.

amount can be at most 2,147,483,647. player is not optional in command blocks, and player must be online.

xp <amount>L [player]

Gives player the amount number of experience levels. Maximum is 2,147,483,647 — if a player is given levels pushing them past this limit, they get reset to 0. Negative amounts may be used to remove experience levels.

amount must be between -2,147,483,648 and 2,147,483,647, inclusive. player is not optional in command blocks, and player must be online.

Multiplayer-only commands[editar]

These commands are only available in multiplayer mode, and are usable by ops (operators) from the server console as well as through the chat window when prefixed by the command character /.

None of these commands make use of target selectors and, with the exception of the list command, none of these commands can be executed by a command block.

Many of these commands can be used on players who have never been to the server, or even on names which are not (or cannot be) registered as Minecraft accounts.

Command Description Success Conditions
ban <name> [reason …] Blacklists the player name from the server so that they can no longer connect. Note: Bans supersede any whitelisting in place. Always succeeds.
ban-ip <address|name> [reason …] Blacklists an IP address so that all subsequent connections from it are rejected. address must be a valid IP or player name must be online.
banlist [ips|players] Displays banned IP addresses or banned players. Always succeeds.
deop <player> Revokes a player's operator status. Always succeeds.
kick <player> [reason …] Forcibly disconnects player from the server, displaying an optional reason to them. player must be online.
list Shows the names of all currently-connected players (the same can be achieved when pressing tab) Always succeeds, even in a command block.
op <player> Grants player operator status on the server. Always succeeds.
pardon <name> Removes player name from the blacklist, allowing them to connect again. Always succeeds.
pardon-ip <address> Removes IP address from the IP blacklist, allowing players from that IP address to connect to the server. address must be a valid IP.
save-all Forces the server to write all pending changes to the world to disk. Always succeeds.
save-off Disables the server writing to the world files. All changes will temporarily be queued. Always succeeds.
save-on Enables the server writing to the world files. This is the default behavior. Always succeeds.
setidletimeout <Minutes until kick> Set the idle kick timer. Any players idle for Minutes until kick will be kicked. Always succeeds.
stop Saves all changes to disk, then shuts down the server. Always succeeds.
whitelist <add|remove> <player> Adds or removes player from the whitelist. Always succeeds.
whitelist list Displays all players in the whitelist. Always succeeds.
whitelist <on|off> Enables/disables the server's use of a whitelist. Note: Server ops will always be able to connect when the whitelist is active, even if their names do not appear in the whitelist. Always succeeds.
whitelist reload Reloads the list of playernames in white-list.txt (1.7.5 or earlier) or whitelist.json (1.7.6 or later) from disk (used when white-list.txt or whitelist.json has been modified outside of Minecraft). Always succeeds.

Data tags[editar]

NBT tags can be specified for items and entities created with the , and other commands. Data tags are data structures. The format is JSON, although it is not strict (lenient). The data is represented as a comma separated list of pairs. Each pair has the format <key>:<value>. The key is the name of the NBT tag and the value is the data that should be assigned to it. Tag names are case-sensitive, and whitespace outside keys or values is ignored.

The value can be different types:

  • String is a piece of text, can be wrapped with double-quotes. Double quotes have to be used if the String contains commas, curly braces or square brackets. To use double-quotes inside Strings, the quote is escaped by a backslash (\"). When using most commands, escaping is disabled (except for double quotes) and keys must not be quoted (probably a bug [1]). This causes an issue where trailing backslashes do not work (as do any other things that need to be escaped), even when escaped properly. The reason is that it escapes the quotation mark after the string which causes a malformed JSON object. Example:"My name is \"Steve\""
  • Number are 1 or more digits that can have a leading sign (+/-). They're classified in Integers, that don't have a decimal mark, Doubles, that uses a dot (.) as a decimal mark, and Floats, that also have f appended after the number. Examples: integer:-128; double:-1.2345; & float:1.2f
  • List (or 'Array') is multiple, comma separated values wrapped with square brackets. The containing values do not need to be of the same type. Example:[1,2,3]
  • Boolean can either be true or false, but using Numbers works, too. When using numbers, 0 is false, everything else is true. Example:true
  • Compound or 'Object' is a container for data structures (as explained above). They are wrapped with curly braces.
Notice: The Data tag itself is a Compound. Example: {Health:18,CustomName:"Friend"}
  • null This is a placeholder an empty value. Do not put quotes. Example:null

When commands such as /testfor, /testforblock, and /clear are used to match NBT tags, they only check for the presence of the given tags in the target entity/block/item. This means that the entity/block/item may have additional tags and will still match. This is true even for lists/arrays: the order of a list is not acknowledged, and as long as every requested element is in the list, it will match even if there are additional elements.

For a complete listing of defined tags (though not all can be modified by commands), see:

For a complete list of identifiers, see:

Raw JSON Text[editar]

The command uses a specific lenient JSON format for raw chat messages. Similar to the NBT format notation above, concepts such as Strings, Objects (Compounds), and Lists are used to represent the various properties of raw chat.

For a direct tutorial to tellraw commands, see this thread. For a tool to easily create tellraw commands, see this. Note that both links are external to the Minecraft Wiki and may be outdated.

The format of "<raw JSON message>" is a JSON Object which supports the following (mostly optional) elements:

  • Nbtsheet.png
    The base chat component Object
    • Nbtsheet.png
       text: A string representing raw text to display directly in chat. Note that selectors such as "@a" and "@p" are not translated into player names; use selector instead.
    • Nbtsheet.png
       extra: A list of additional objects, sharing the same format as the base object.
      • Nbtsheet.png
        A list element with the same format as the base object (recursive). Note that all properties of this object are inherited by children except for text, extra, translate, with, and score. This means that children will retain the same formatting and events as this object unless they explicitly override them.
    • Nbtsheet.png
       color: The color to render this text in. Valid values are "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white", and "reset" (cancels out the effects of colors used by parent objects). Technically, "bold", "underline", "italic", "strikethrough", and "obfuscated" are also accepted, but it may be better practice to use the tags below for such formats.
    • Nbtsheet.png
       bold: Boolean (true/false) - whether to render text in bold. Defaults to false.
    • Nbtsheet.png
       underlined: Boolean (true/false) - whether to render text underlined. Defaults to false.
    • Nbtsheet.png
       italic: Boolean (true/false) - whether to render text in italics. Defaults to false.
    • Nbtsheet.png
       strikethrough: Boolean (true/false) - whether to render text with a strikethrough. Defaults to false.
    • Nbtsheet.png
       obfuscated: Boolean (true/false) - whether to render text obfuscated. Defaults to false.
    • Nbtsheet.png
       insertion: When the text is shift-clicked by a player, this string will be inserted in their chat input. It will not overwrite any existing text the player was writing.
    • Nbtsheet.png
       clickEvent: Allows for events to occur when the player clicks on text.
      • Nbtsheet.png
         action: The action to perform when clicked. Valid values are "open_url" (opens value as a URL in the player's default web browser), "run_command" (has value entered in chat as though the player typed it themselves. This can be used to run commands, but the command will fail if the player does not have the required permissions to use it), and "suggest_command" (similar to "run_command", but the text only appears in the player's chat input, and is not automatically entered. Unlike insertion, this will replace the existing contents of the chat input).
      • Nbtsheet.png
         value: The URL, chat, or command used by the specified action. Note that commands must be prefixed with the usual "/" slash.
    • Nbtsheet.png
       hoverEvent: Allows for a tooltip to be displayed when the player hovers their mouse over text.
      • Nbtsheet.png
         action: The type of tooltip to show. Valid values are "show_text" (shows raw JSON text), "show_item" (shows the tooltip of an item which can have NBT tags), "show_achievement" (shows formatted text describing an achievement or statistic. Normal achievement names are green, final achievement names are dark_purple, and statistic names are gray. In addition, a description is given for achievements), and "show_entity" (shows an entity's name, possibly its type, and its UUID).
      • Nbtsheet.png
         value: The formatting of this tag varies depending on the action. Note that "show_text" is the only action to support an Object as the value; all other action values are Strings and should thus be wrapped in quotes.
        • "show_text": Can be either a raw String of text, or an Object with the same formatting as this base object. Note that clickEvent and hoverEvent do not function within the tooltip, but the formatting and extra tags still work.
        • "show_item": A string formatted like item NBT data. Contains the "id" tag, and optionally the "Damage" tag and "tag" tag (which is the same compound used as "dataTag" in the command).
        • "show_achievement": The achievement or statistic's name. This uses the same format as achievement and statistic Scoreboard objective criteria and the command.
        • "show_entity": A string formatted like a compound with the string values "type" (such as "Zombie"), "name", and "id" (should be an entity UUID, but can actually be any string).
    • Nbtsheet.png
       translate: The translation identifier of text to be displayed using the player's selected language. This identifier is the same as the identifiers found in lang files from assets or resource packs. The translated text will only be displayed if the text string is not used.
    • Nbtsheet.png
       with: A list of chat component arguments and/or string arguments to be used by translate.
      • The arguments are text corresponding to the arguments used by the translation string in the current language, in order (for example, the first list element corresponds to "%1$s" in a translation string).
    • Nbtsheet.png
       score: A compound for displaying a player's score in an objective. Displays nothing if the player is not tracked in the given objective. Ignored completely if text or translate is present.
      • Nbtsheet.png
         name: The name of the player whose score should be displayed. Selectors (such as @p) can be used, in addition to "fake" player names created by the scoreboard system. In addition, if the name is "*", it will show the player's own score (for example, /tellraw @a {score:{name:"*",objective:"obj"}} will show every online player their own score in the "obj" objective). Note that non-player entity scores (such as @e[type=Cow]) do not show, even if the entity has been given a score in the objective.
      • Nbtsheet.png
         objective: The internal name of the objective to display the player's score in.
      • Nbtsheet.png
         value: Optional. If present, this value is used regardless of what the score would have been.
    • Nbtsheet.png
       selector: A string containing a selector (@p,@a,@r, or @e) and, optionally, selector arguments. Unlike text, the selector will be translated into the correct player/entity names. If more than one player/entity is detected by the selector, it will be displayed in a form such as 'Name1 and Name2' or 'Name1, Name2, Name3, and Name4'. Ignored completely if text, translate, or score is present.

Due to the extra tag, the above format may be recursively nested to produce very complex and functional text strings. However, a raw json string doesn't have to be complicated at all: virtually all properties are optional and may be left out.

To be valid, each object must have at least either text, translate, or score (everything else is optional). As a matter of shorthand, however, the entire Object may be substituted for a String. In this case, that string will be considered the value of the text property. For example, "This is raw text" is equivalent to {text:"This is raw text"}. This shorthand substitution is valid anywhere a raw text object is required (including the base <raw json message> argument of , the elements of the extra list, and the value of a "show_text" hover_event).

Finally, unlike other commands using JSON, Strings support Unicode via the notation \u####, where #### is the Unicode hexadecimal number for the desired character.

Historial[editar]

Clásica
0.0.15a_03 Added /ban, /ban-ip, /banlist, /broadcast, /deop, /kick, /list, /op, /pardon, /pardon-ip, /save-all, /save-on, /save-off, /stop, and /whitelist.
0.0.16a_01 Changed /broadcast to /say.
0.0.17a Added /setspawn.
0.0.20 Added /solid.
Lanzamiento oficial
1.3.1 12w16a Added cheats mode and /gamemode, /give, /kill, /time, /toggledownfall, and /xp.
12w21a Added /seed.
12w22a Added /defaultgamemode.
12w24a Added /publish.
12w25a Cheats can now be turned on or off when opening a world to other players through LAN.
12w27a Added /debug.
1.4.2 12w32a Added /difficulty, /gamerule, /spawnpoint, and /weather.
Added target selectors.
12w37a Added /clear.
12w38a /clear can now be used to remove specific blocks/items.
12w41a The limit for /xp is now 2,147,483,647 instead of 5,000.
1.4.4 1.4.4pre Added /enchant.
1.5 13w03a Added /testfor.
13w04a Added /scoreboard.
13w09b Added /effect.
1.6 13w23a Added /spreadplayers.
Added gamerule naturalRegeneration.
13w24a Added gamerule doDaylightCycle.
1.6pre Added clear argument to /effect.
1.6.1pre Added /playsound.
1.7.2 13w36a Added /summon.
Added dataTag argument to /give.
13w37a Added /setblock, /tellraw, and /testforblock.
13w38a Added /setidletimeout.
13w43a Added /setworldspawn.
1.8 14w02a Added /blockdata.
Added @e selector.
Added optional player/entity argument to /kill.
Added additional arguments to /clear and /testfor.
/testfor is no longer exclusive to command blocks.
Added insertion tag to /tellraw.
14w03a Added rotation arguments to /tp.
Added dx, dy, and dz to selector arguments.
Added /clone and /fill.
Added gamerule logAdminCommands.
14w04a Added /particle.
14w05a Added spectator to /gamemode and /defaultgamemode.
14w06a Added hideParticles argument to /effect.
Added /trigger.
14w07a Added /execute and /testforblocks.
/testfor can now test for partial NBT tag matches.
14w08a Commands run using /execute now pass their success value back to the command block running them.
14w10a Added gamerule showDeathMessages.
Added the force option to /clone.
14w17a Added /worldborder.
Added gamerule randomTickSpeed.
14w19a Added damage and warning arguments to /worldborder.
14w20a Added /title.
Added selector argument to /tellraw.
Added the move option to /clone.
14w26a Added add argument to /worldborder.
Added /replaceitem.
Added gamerule sendCommandFeedback

Cuestiones[editar]

Los problemas relacionados con "comandos" se mantienen en el rastreador de problemas. Informad (en inglés) en esta página sobre los errores que encontréis.

Veáse también[editar]