ResourceLocationException: Non [a-z0-9/._-] character in path of location crash

Section

When updating your mod from Minecraft 1.12.2 or earlier to Minecraft 1.14.4 or higher, you might have encountered a crash when trying to launch a game or the game works, but recipes, drops and such do not work, and the crash log contains lines like:

net.minecraft.util.ResourceLocationException: Non [a-z0-9/._-] character in path of location: modid:items/some texture name
	at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:30) ~[?:?] {re:classloading}
	at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:35) ~[?:?] {re:classloading}
	at net.minecraft.client.renderer.model.BlockModel.lambda$getTextures$1(BlockModel.java:163) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_222] {}
	at net.minecraft.client.renderer.model.BlockModel.getTextures(BlockModel.java:162) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}{}

The important part of this crash log is:

net.minecraft.util.ResourceLocationException: Non [a-z0-9/._-] character in path of location: modid:items/some texture name

Minecraft 1.14.4 only allows lowercase English alphabet letters, numbers 0-9 and /._- characters. If the texture file contains other characters such as whitespace in your mod, this will cause the Minecraft to crash. This rule applies to:

  • texture names
  • sound names
  • structure names
  • model and model part names
  • tag names

If this error happens to you, check the error log to see which resource is causing this problem/crash. You can go to Workspace tab -> Resouces -> Textures and check for the textures marked with a yellow exclamation mark. These textures have been detected to have invalid names by MCreator and you need to rename these.

To rename these, go to the <workspace folder>/textures and rename all problematic textures there.

After you rename them in the textures folder, make sure to reselect these textures in the mod elements and texture mappings that use them as the mod elements still refer to the texture file names with invalid characters in their file names and until you do this, the game will still crash.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.