Description
This rule enforces a consistent naming convention for keys in NBT compound tags and NBT paths.
This linter only checks the naming in the following cases:
-
This is a key definition in an nbtdoc compound definition block that is outside of the
::minecraft
module; -
This is a key used in an NBT compound tag that doesn’t have an associated nbtdoc definition; OR
-
This is a key used in an NBT path that doesn’t have an associated nbtdoc definition.
JSON Format
-
(string) A regex specifying the pattern of the name. The name will be considered valid if any part of it matches the regex, so use
^
and$
if you want the full name to be tested.
Example 1. Snake case
Config
{
"lint": {
"nameOfNbtKey": "^[a-z]+(_[a-z]+)*$"
}
}
👍 Good
give @s stone{foo: true}
give @s stone{foo_bar: true}
👎 Bad
give @s stone{FooBar: true}