Los identificadores de objeto (también conocidos como líneas de nombre,[1] localizaciones de recursos,[2] o identificadores de recursos[3]) son una forma de declarar e identificar los objetos incluidos en el juego y definidos por los usuarios al jugar a Minecraft, evitando ambigüedades generadas por sus nombres.
Sumario
Uso[]
Los identificadores con nombre se usan como líneas de texto para hacer referencia a bloques, objetos, tipos de entidades, recetas, funciones, logros, etiquetas y otros tipos de objetos en el juego estándar de Minecraft. Curiosamente, los estados de bloque no se consideran como estados con nombre.
Un identificador con nombre válido tiene el siguiente formato: :name
, donde solo se pueden emplear ciertos caracteres.
Esta es una lista de todos los lugares que contienen IDs con espacio de nombres:
- REGISTROS INCORPORADOS
-
- Atributos
- Bloques
- Bloques entidad[Solo Java Edition]
- Fluidos[Solo Java Edition]
- Objetos
- Entidades
- Mob memories[Solo Java Edition]
- Painting motives[Solo Java Edition]
- Trabajos de Aldeanos[Solo Java Edition]
- Tipos de Aldeanos[Solo Java Edition]
- Estado de efectos de poción
- Tipos de poción[Solo Java Edition]
- Encantamientos
- Partículas
- Dimensiones[Solo Java Edition]
- Biomas
- Estadísticas [Solo Java Edition]
- Tipos de receta[Solo Java Edition]
- Serializadores de pociónes[Solo Java Edition]
- Efectos de sonido
- Contenidos de data packs[Solo Java Edition]
-
- Logros
- Probabilidades de Loot
- Funciones
- Archivos de estructuras
- Recetas
- Bloques/Fluidos/Items/Tipos de entidad/Tags de funciones
- Contenidos de add-ons[Solo Bedrock Edition]
-
- Tablas de loot
- Funciones
- Contenidos de Texture packs[Solo Java Edition]
-
- Archivos de estado de bloque
- Modelos
- Texturas
- Sonidos
- Otros contenidos customisados[Solo Java Edition]
-
- Barras de vida de jefes
- Almacenamiento de comandos
- Other non-customizable (without mods) contents
-
- Loot functions
- Loot conditions
- Loot types
- Command argument types
Legal characters[]
Edición Java[]
The namespace and the name of an ID should only contain the following symbols:
0123456789
Numbersabcdefghijklmnopqrstuvwxyz
Lowercase letters_
Underscore-
Hyphen/minus.
Dot
The following characters are illegal in the namespace, but acceptable in the name:
/
Forward slash (directory separator)
The preferred naming convention for either namespace or name is snake_case
.
Edición Bedrock[]
The namespace and the name of an ID can contain all symbols with the exception of slashes and colons.
The following characters are illegal in the namespace, but acceptable in the name of loot tables and functions.
/
Forward slash (directory separator)
The preferred naming convention for either namespace or name is snake_case
.
Conversion to string[]
A namespaced ID would be converted to a string by appending its namespace with a :
(colon) and its name.
Ejemplos:
Namespace | Name | String representation |
---|---|---|
minecraft |
diamond |
minecraft:diamond
|
foo |
bar.baz |
foo:bar.baz
|
minecraftwiki |
commands/minecraft_wiki |
minecraftwiki:commands/minecraft_wiki
|
Conversion from string[]
Unlike that namespaced IDs can always be converted to strings, some strings cannot convert to namespaced IDs.
Existen una serie de restricciones:
- The string can have at most one
:
(colon) character - The rest of the string must fulfill the requirement of legal characters
- If the
:
is present, the part of string before the:
(the namespace) must not contain/
or.
When the :
is present, the part of string before the :
becomes the namespace and that after the :
becomes the name.
When the :
is absent, minecraft
becomes the namespace and the whole string becomes the name.[Solo Java Edition]
It is recommended to always include a :
in the string format of namespaced IDs.
- Examples
String | Resolved namespace | Resolved name | What the game converts it back to |
---|---|---|---|
bar:code |
bar |
code |
bar:code
|
minecraft:zombie |
minecraft |
zombie |
minecraft:zombie
|
diamond |
minecraft [Solo Java Edition]None[Solo Bedrock Edition] |
diamond |
minecraft:diamond [Solo Java Edition]diamond [Solo Bedrock Edition]
|
foo/bar:coal |
Invalid character / |
||
minecraft/villager |
minecraft [Solo Java Edition]None[Solo Bedrock Edition] |
minecraft/villager |
minecraft:minecraft/villager [Solo Java Edition]minecraft/villager [Solo Bedrock Edition]
|
mypack_recipe |
minecraft [Solo Java Edition]None[Solo Bedrock Edition] |
mypack_recipe |
minecraft:mypack_recipe [Solo Java Edition]mypack_recipe [Solo Bedrock Edition]
|
mymap:schrödingers_var |
mymap |
Invalid character ö [Solo Java Edition]schrödingers_var [Solo Bedrock Edition] |
mymap:schrödingers_var [Solo Bedrock Edition]
|
custom_pack:Capital |
custom_pack |
Invalid character C [Solo Java Edition]Capital [Solo Bedrock Edition] |
custom_pack:Capital [Solo Bedrock Edition]
|
Locating contents in packs[]
Given objects from resource packs and data packs are files, the namespaced ID can also be used to find corresponding files that declared objects of the ID.
Though the locations varies by object type and the pack type the object type belongs to, there is a pattern to follow. In general, The location is in a fashion of pack_type/namespace/object_type/name.suffix
, where all the /
(forward slash) symbol (may be part of object_type
or name
) is replaced by operating system-dependent directory separator.
Mappings from object type to pack_type
, object_type
, and suffix
variables
Object Type | Object's pack | pack_type substitution |
object_type substitution |
suffix substitution
|
---|---|---|---|---|
Block States | Resource pack | assets |
blockstates |
json
|
Models | Resource pack | assets |
models |
json
|
Particles | Resource pack | assets |
particles |
json
|
Textures | Resource pack | assets |
textures |
png
|
Advancements | Data pack | data |
advancements |
json
|
Functions | Data pack | data |
functions |
mcfunction
|
Loot tables | Data pack | data |
loot_tables |
json
|
Recipes | Data pack | data |
recipes |
json
|
Structures | Data pack | data |
structures |
nbt
|
Block tags | Data pack | data |
tags/blocks |
json
|
Entity type tags | Data pack | data |
tags/entity_types |
json
|
Item tags | Data pack | data |
tags/items |
json
|
Fluid tags | Data pack | data |
tags/fluids |
json
|
Function tags | Data pack | data |
tags/functions |
json
|
Note: Certain elements in the resource pack is not necessarily backed by an object with namespace ID, such as GUI textures.
Given the type of content we want to locate, we can find out the corresponding pack_type
, object_type
, and suffix
. Then, we can substitute in and find out the final file location of the content.
Examples
ID con espacio de nombre | Tipo de contenido | pack_type |
object_type |
suffix |
Ubicación final |
---|---|---|---|---|---|
my_texture_pack:diamonds |
Texture | assets |
textures |
png |
assets/my_texture_pack/textures/diamonds.png
|
abc:run_game |
Function | data |
functions |
mcfunction |
data/abc/functions/run_game.mcfunction
|
block/torch (same as minecraft:block/torch ) |
Model | assets |
models |
json |
assets/minecraft/models/block/torch.json
|
load (same as minecraft:load ) |
Function Tag | data |
tags/functions |
json |
data/minecraft/tags/functions/load.json
|
rocket_pack:industry/start_of_story |
Advancement | data |
advancements |
json |
data/rocket_pack/advancements/industry/start_of_story.json
|
Namespaces[]
![]() |
“ |
|
„ |
— Dinnerbone en namespaces[4] |
A namespace is a domain for contents. It is to prevent potential content conflicts or unintentional overrides of object of a same name.
For example, two data packs add two minigame mechanisms to Minecraft; both have a function named start
. Without namespaces, these two functions would clash and the minigames would be broken. When they have different namespaces of minigame_one
and minigame_two
, the functions would become minigame_one:start
and minigame_two:start
, which no longer conflict.
minecraft
namespace[]
Minecraft reserves the minecraft
namespace; when a namespace is not specified, a namespaced ID falls back to minecraft
[Solo Java Edition]. As a result, the minecraft
namespace should only be used by content creators when the content needs to overwrite or modify existing Minecraft data, such as adding a function to the minecraft:load
function tag.
Custom namespace[]
The namespace should be distinct for different projects or content creations (e.g. a data pack, a resource pack, a mod, backing data/resource packs for a custom map, etc.)
To prevent potential clashes, the namespace should be as particular as possible.
- Avoid alphabet soups. For example, a project named "nuclear craft" should not use the namespace
nc
, as this is too ambiguous. - Avoid words that are too vague.
battle_royale
would not be informative to look up as well, butplayer_name_battle_royale
would be much better.
In either case, these poorly chosen namespaces reduces the exposure of a project and brings difficulties for debugging when there is multiple content creations applied to the game.
Other built-in namespaces[]
The default resource pack of Minecraft declares Realms-oriented language files in the realms
namespace (located at assets/realms/lang/<language-code>.json
) and game-related language files in the minecraft
namespace, even though translation keys are not namespaced IDs. The realms jar itself also declares its en_us.json
language file and its various textures in the realms
namespace.
In the IDs of command argument types, a brigadier
namespace also appears for command argument types that are native to Brigadier.[5]
Historial[]
Java Edition | |||||
---|---|---|---|---|---|
1.6.1 | 13w21a | Added namespaced IDs alongside the minecraft prefix for identifying assets. | |||
1.7.2 | 13w37a | Commands now accept name IDs aside from numerical IDs. | |||
1.11 | 16w32a | Namespaced IDs now have a character restriction. | |||
Disallowed uppercase characters in namespaced IDs. | |||||
1.13 | 17w47a | After the flattening, namespaced IDs are the only accepted form of ID. | |||
pre4 | Namespaced IDs are now used to identify plugin message channels.[6] | ||||
1.14.4 | pre1 | The realms namespace is added to the client jar's builtin resource pack. | |||
1.16 | 20w14a | Attributes are now namespaced IDs. | |||
Pocket Edition Alpha | |||||
0.16.0 | build 1 | Added commands, which supported string IDs. However, these IDs were not namespaced yet. | |||
Bedrock Edition | |||||
1.12.0 | beta 1.12.0.2 | IDs are now namespaced using the minecraft prefix, to support custom items being added through add-ons. |
See also[]
- Java Edition data values
- Resource pack
- Data pack
Referencias[]
- ↑ DataFixerUpper/NamespacedStringType.java at 8b5f82ab78b30ff5813b3a7f3906cd3f4f732acf · Mojang/DataFixerUpper – GitHub
- ↑ Minecraft Java Edition 1.13 changes – GitHub Gist
- ↑ "Minecraft Snapshot 19w39a" – Minecraft.net, September 27, 2019
- ↑ "Minecraft Snapshot 17w43a" – Minecraft.net
- ↑ Minecraft Java Edition 1.13 changes – GitHub Gist
- ↑ Protocol History – wiki.vg
Enlaces externos[]
- Namespaces, as explained in "Minecraft Snapshot 17w43a" – Minecraft.net.
Versiones | |||||||
---|---|---|---|---|---|---|---|
Desarrollo |
| ||||||
Técnico |
| ||||||
Multijugador |
| ||||||
Personalización del juego |
Ediciones |
| ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Desarrollo |
| ||||||||||
Técnico |
| ||||||||||
Multijugador | |||||||||||
Exclusivo |
| ||||||||||
Removido |
|