Simplified Guide to Namespace IDs
A Namespaced ID is a term used to describe an object that is registered in Minecraft to ensure there are no conflicts or ambiguity and thus, less issues during gameplay.
Knowledge of this is essential to understanding how mods work.
What exactly does this Namespace ID entail?
It's a combination of two words used by Minecraft to determine what an object is.
The general formatting of this is:
namespace:RegistryName
Namespace
The Namespace is the name of a programming project and used to help programmers and users know where this object came from. However, in the specific context of Minecraft, Mojang's naming conventions dictate that this is all lowercase.
An example of this is an object that has the namespace of "thaumcraft". When Minecraft is adding or getting information from an object in its game, it will know, "Ok, this object is coming from a project called Thaumcraft and not Minecraft's original project"
The namespace is required to be all lowercase according to Mojang's naming conventions.
Registry Name
The Registry Name is the specific name used by the object to let us know what the object is.
An example of this if you see an object that has the registry name of, "tech_floor_plate". When Minecraft is adding or getting information from an object in its game, it will know, "Ok, this object is called tech_floor_plate and not something like grass_block".
The registry name is required to be all lowercase according to Mojang's naming conventions.
Now when we combine the Namespace and Registry name into the namespace ID, we add a colon between the Namespace and Registry Name. This is our final Namespace ID.
When and How do we use it?
An example of this being used is finding which mod a block has come from.
Say, you find the Namespace ID of a block called "immersiveengineering:lead_ore".
Using our knowledge of Namespace and Registry name, we now know that this block comes from a project called "immersiveengineering" and the registry name of this block is called "lead_ore".
Finding the Namespace ID
To find the Namespace ID, the easiest way to find this ingame.
When you load up the game, press the keys F3 and H. This will turn on Advanced Tooltips mode, which allows you to see more information if you hover over an item in the inventory GUI.
You may notice that when you hover over an item with Advanced Tooltips Enabled (F3 + H), you will see two articles of text.
-
White text that shows you the name of the item.
This is called the Translated Text, much like the output of a language translator.
It's what Minecraft uses to make their features more user friendly.
If this name was not "translated", "it will merely show the namespace and registry name.- Example: Untranslated text could look like, "item.tardis.tech_floor_plate"
- Example: Translated text would be "Steel Plate"
-
Grey text below the White text. This is our Namespace ID
- When want to use this to reference a block, item or any feature in general, we need to use this string of text.
- Do not use the White text, because that is not the Namespace ID.