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 calleddirt
that is added byminecraft
.create:zinc_ingot
- An entry calledzinc_ingot
that is added bycreate
.tipsmod:smoke_bees
- An entry calledsmoke_bees
that is added bytipsmod
.
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 Location | Validity | Explanation |
---|---|---|
This resource location is valid! | ||
This resource location is valid! | ||
This resource location is valid! | ||
Spaces are not allowed! | ||
Upper case characters are not allowed! | ||
Non-latin alphabet is not allowed. | ||
Forward slash can only be used in paths. | ||
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
.