Apparently Minecraft treats one character long namespaces as "minecraft:"
How to reproduce
/give @p a:stone
Works/give @p aa:stone
Does not work
/effect @p a:instant_health
Works/effect @p aa:instant_health
Does not work
/advancement grant/revoke only a:root
Works, affects minecraft:root/advancement grant/revoke only aa:root
Doesn't work, unless you created a custom advancement withaa
namespace
Create
a:test
function/function @p a:test
Doesn't workCreate
minecraft:test
function and repeat step 2
Works
(same can be done with advancements)
Code analysis
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
The reason why this happens is because the method net.minecraft.util.ResourceLocation.splitObjectName(String)
only uses the provided namespace if the index of the colon (":") is higher than 1. Instead it should probably test if it is higher then 0 because only if it is 0 the String starts with the colon.
protected static String[] splitObjectName(String toSplit)
{
String[] astring = new String[] {"minecraft", toSplit};
int i = toSplit.indexOf(58);
if (i >= 0)
{
astring[1] = toSplit.substring(i + 1, toSplit.length());
// Replaced this
//if (i > 1)
if (i > 0)
{
astring[0] = toSplit.substring(0, i);
}
}
return astring;
}
How about a letter that is not included in the word "minecraft" for example "L"