Skip to content

How can I fix invalid identifier exceptions in my mod? #4353

Closed Answered by haykam821
haykam821 asked this question in FAQ
Discussion options

You must be logged in to vote

When registering content for your mod, you must ensure that identifiers (the internal names given to registered content) follow the rules for identifier namespaces and paths. Your code may contain code such as the following:

// 'MODID' is an invalid namespace here
Identifier invalidId1 = Identifier.of("MODID", "test_content");
Identifier invalidId2 = Identifier.of("MODID:test_content");

// 'TestContent' is an invalid path here
Identifier invalidId3 = Identifier.of("modid", "TestContent");
Identifier invalidId4 = Identifier.of("modid:TestContent");

This code will throw an exception because the identifiers do not follow the correct format. There are a few rules to consider:

  • Valid identifi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by haykam821
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
FAQ
Labels
None yet
1 participant