Cambios

Saltar a: navegación, buscar

Comandos

283 bytes añadidos, 04:02 19 jul 2014
Data tags
== Data tags ==
Las [[Formato NBT format|etiquetas NBT tags]] can be specified for items and entities created with the (NBT tags) se puede especificar para los objetos y las entidades creadas con el {{cmd|give}}, {{cmd|summon}} and other commandsy otros comandos. Data tags are Etiquetas de datos son [[wikipedia:Data structure|data structuresestructuras de datos]]. The format is El formato es [[wikipedia:JSON|JSON]], although it is not strict aunque no es estrictamente ([https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient%28boolean%29 lenient]). The data is represented as a comma separated list of pairsLos datos se representan como una lista separada por comas de pares. Each pair has the format Cada par tiene el formato <code><key>:<value></code>. The key is the name of the La clave está en el nombre de la etiqueta de NBT tag and the value is the data that should be assigned to ity el valor es el dato que se debe asignar a la misma. Tag names are case-sensitiveLos nombres de etiquetas distinguen entre mayúsculas y minúsculas, and whitespace outside keys or values is ignoredy las llaves o valores fuera de espacio en blanco se ignora.
The value can be different typesEl valor puede ser de diferentes tipos:
* '''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 (<code>\"</code>). When using most commands, escaping is disabled (except for double quotes) and keys must not be quoted (probably a bug [https://mojang.atlassian.net/browse/MC-37661]). 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. <code>Example:"My name is \"Steve\""</code>
* '''null''' This is a placeholder an empty value. Do not put quotes. <code>Example:null</code>
When commands such as Cuando se utilizan comandos como {{cmd|/testfor}}, {{cmd|/testforblock}}, and y {{cmd|/clear are used to match }} para que coincida con las etiquetas NBT tags, they only check for the presence of the given tags in the target entitysólo comprobará la presencia de las etiquetas que figuran en la entidad/blockbloque/itemobjeto de destino. This means that the entityEsto significa que la entidad/blockbloque/item may have additional tags and will still matchobjeto puede tener etiquetas adicionales y todavía coincidir. This is true even for listsEsto es cierto incluso para las listas/arrayscolecciones: the order of a list is not acknowledgedel orden de la lista no es reconocido, and as long as every requested element is in the listy siempre y cuando cada elemento solicitado está en la lista, it will match even if there are additional elementscoincidirá incluso si hay elementos adicionales.
For a complete listing of defined tags Para obtener una lista completa de las etiquetas definidas (though not all can be modified by commandsaunque no todas pueden ser modificadas por los comandos), seeconsulta:
* [[Chunk format#Block Format|Blocks]]
* [[Chunk format#Entity Format|Entities]]
** [[Player.dat#Item structure|Items]] (items in player's inventory or containers)
For a complete list of identifiersPara obtener una lista completa de los identificadores, seeconsulta:
* [[Data values#Block IDs|blocks]]
* [[Data values#Item IDs|items]]
Colaborador, Bots, Administradores
10 223
ediciones

Menú de navegación