Skip to content

Resource Locations

Minecraft uses resource locations to identify and organize game objects. They are sometimes called namespaced identifiers or just identifiers. If you have seen an ID like minecraft:dirt you have already seen a resource location.

Structure

Resource locations have two parts that are separated using a colon :. The first half is called the namespace. The namespace is the source of the resource. The second half is the path, which is the resource itself. Here are a few examples breaking down resource locations.

  • minecraft:dirt - An entry called dirt that is added by minecraft.
  • create:zinc_ingot - An entry called zinc_ingot that is added by create.
  • tipsmod:smoke_bees - An entry called smoke_bees that is added by tipsmod.

Valid Characters

Resource locations can only contain the following characters. Using an invalid character in your resource location will prevent your resource from loading or being used.

  • Lowercase latin alphabet - abcdefghijklmnopqrstuvwxyz
  • Numbers - 0123456789
  • Underscore - _
  • Hyphen - -
  • Period - .

The path may also use a forward slash (/). The forward slash is not valid for namespaces.

Examples

Resource LocationValidityExplanation
minecraft:dirt

This resource location is valid!

example_mod:stone

This resource location is valid!

test_mod:smelting/double_ores

This resource location is valid!

example:my mod

Spaces are not allowed!

MyPack:My_Id

Upper case characters are not allowed!

mypack:грязь

Non-latin alphabet is not allowed.

mypack/ores:platinum_ore

Forward slash can only be used in paths.

example:stone#painted

Underscores, hyphens, and periods are the only special characters allowed.

File Paths

Resource locations can also be used to reference a file in a data pack or resource pack. The namespace and path are combined with a resource type to create the file path. This process also works in reverse, using the location and name of a file to create a resource location. Additionally, data files are held in a data folder while client side resources like textures and models are held in an assets folder.

To give an example, a recipe with the resource location example:dirt is referencing the data/example/recipes/dirt.json file. If a file is located in sub-folders forward slashes will be used. For example the texture assets/example/textures/item/my_texture.png is referenced using the resource location example:item/my_texture.