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
(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
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:
- En un servidor multijugador, desde un administrador de servidor o desde un bloque de comandos.
- En otros juegos multijugador, desde el jugador que abrió el juego LAN con trampas activadas, o desde la persona que aloja su propio servidor multijugador.
- En modo un jugador, en caso de que los comandos sean habilitados en la creación del mundo (a través del botón "Más opciones del mundo...").
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 (
-> "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
Leyenda
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
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
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
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] |
---|---|---|
|
Muestra una lista de los comandos disponibles o información detallada sobre el |
Se ejecuta con éxito si |
|
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 |
Todos los selectores de objetivo (p.ej., |
|
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 |
Todos los selectores de objetivo (p.ej., |
|
Se utiliza junto a El comando |
|
- ↑ 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
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 |
---|---|---|
|
Da a un jugador un logro, y todos los logros previos, o incrementa una puntuación 1 punto. |
|
|
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 |
|
|
Limpia el inventario de Los argumentos de |
Se deben borrar al menos cero objetos, y |
|
Clona un área dada. El destino es (x, y, z), donde los bloques son colocados en el lado de las coordenadas positivas.
El comando |
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) |
|
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. |
|
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: |
|
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. |
|
|
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 |
If clearing an effect, the player must have this effect. |
|
Clears all effects on |
At least one effect must be removed, and |
|
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. |
|
Runs The |
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 The |
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. |
|
Fills the given area with a block specified by
The |
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) |
|
Replaces all blocks matching The |
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) |
|
Changes the game mode for |
|
|
Activates or deactivates the Available rules are:
The following rules will be added in 1.8 and are currently available only in the snapshots:
Valid |
Succeeds in all cases - even absent/invalid |
|
Spawns |
|
|
Inflicts 1000 × 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 The |
|
|
Spawns particles in a given area or at a given player/entity. The |
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. |
|
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 The The |
|
|
Opens your single-player game for LAN friends to join. This command appears in the singleplayer cheats. |
Cannot be used in a command block. |
|
Replaces an item in a certain slot of a container block with another item. The The |
The block must be a container block and the slot and item arguments must be correct. |
|
Replaces an item in a certain slot of an entity (player or mob) with another item. The
The |
The player must be online and the slot and item arguments must be correct. |
|
Broadcasts |
All target selectors (e.g., @p) in the message must evaluate. |
|
See Scoreboard for more information. Scoreboard-specific commands. |
|
|
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). |
|
Places the block in the x, y and z coordinates specified. |
|
|
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. |
|
Sets the spawnpoint of that player to that position, or to the current position if x y and z are not specified. 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. |
|
|
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.
|
x and z must be within the range -30,000,000 to 30,000,000 (exclusive), |
|
Spawns an entity. For example, to create a charged creeper named Powered Creeper at the player's current location:
|
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). |
|
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. |
|
|
Used to test whether the given |
|
|
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.) |
|
|
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).
The |
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. |
|
Sets the world time. |
|
|
Increments the world time, as above. |
|
|
Removes title from The |
|
|
Resets subtitle, fadeIn time, stay time, and fadeOut time for The |
|
|
Sets the subtitle text for The |
|
|
Sets the time in game ticks for title (and optional subtitle) to fade in, persist, and fade out, for The |
|
|
Sets the title text for The |
|
|
Toggles rain and snow. |
Always succeeds. |
|
Teleports |
|
|
Teleports 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. |
|
Changes the weather for the specified duration. |
|
|
Adds blocks to the current size of the world border. Can use negative (-) numbers to subtract the size of the border. The |
Always succeeds even if the
|
|
Sets the center of the world border. The |
x and z must fall within the range -30,000,000 to 30,000,000 (exclusive). |
|
Sets the amount of damage inflicted per second per block past the world border buffer (defaults to 0.2). For example, if The |
|
|
Sets the buffer distance outside the world border before damage begins to be inflicted (defaults to 5.0). The |
|
|
Sets the diameter of the world border. The |
|
|
Sets the distance inside the world border where visual warning of world border proximity begins (defaults to 5). The |
|
|
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 The |
|
|
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. |
|
|
Gives |
|
Multiplayer-only commands
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
NBT tags can be specified for items and entities created with the /give
, /summon
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 havef
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
orfalse
, 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"}
- Notice: The Data tag itself is a Compound. Example:
- 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:
- Blocks
- Entities
- Mobs
- Projectiles (arrows, fireballs, thrown potions, etc.)
- Items (items on the ground)
- Vehicles (boats, minecarts, etc.)
- Dynamic Tiles (primed TNT, falling sand/gravel)
- Other Entities (firework rockets, paintings, and item frames)
- Tile Entities (chests, furnaces, command blocks, mob spawners, signs, etc.)
- Player
- Items (items in player's inventory or containers)
For a complete list of identifiers, see:
- blocks
- items
- entities
- enchantments
- status/potion effects
- attributes
Raw JSON Text
The /tellraw
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:
- The base chat component Object
- 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.
- extra: A list of additional objects, sharing the same format as the base object.
- 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.
- 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.
- bold: Boolean (true/false) - whether to render text in bold. Defaults to false.
- underlined: Boolean (true/false) - whether to render text underlined. Defaults to false.
- italic: Boolean (true/false) - whether to render text in italics. Defaults to false.
- strikethrough: Boolean (true/false) - whether to render text with a strikethrough. Defaults to false.
- obfuscated: Boolean (true/false) - whether to render text obfuscated. Defaults to false.
- 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.
- clickEvent: Allows for events to occur when the player clicks on text.
- 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).
- value: The URL, chat, or command used by the specified action. Note that commands must be prefixed with the usual "/" slash.
- hoverEvent: Allows for a tooltip to be displayed when the player hovers their mouse over text.
- 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).
- 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
/give
command). - "show_achievement": The achievement or statistic's name. This uses the same format as achievement and statistic Scoreboard objective criteria and the
/achievement
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).
- 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.
- 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).
- 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.
- 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. - objective: The internal name of the objective to display the player's score in.
- value: Optional. If present, this value is used regardless of what the score would have been.
- 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,
- 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 /tellraw
, the elements of the extra list, and the value of a "show_text" hover_event).
Finally, unlike other commands using JSON, /tellraw
Strings support Unicode via the notation \u####
, where #### is the Unicode hexadecimal number for the desired character.
Historial
Plantilla:History
c | |||||
---|---|---|---|---|---|
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 . | ||||
r | |||||
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 | |||||
u |
Cuestiones
Plantilla:Issue list