datapack-json v2.0.15
Installation
npm i datapack-jsonCustom Properties
There are two custom properties for string schema: parser and params, which should be used to validate the content of the string.
List of Parsers
Command Parser
A parser used to validate commands.
Parameters
leadingSlash: (boolean |null) Whether the command should start with slash (/). The string won't be validated if the value doesn't start with slash and the parameter is set totrue.
Entity Parser
A parser used to validate entities.
Parameters
amount: (single|multiple) The acceptable amount of entities.type: (entities|players) The type of the entities.isScoreHolder: (boolean) Optional, defaults tofalse. Whether this entity is a score holder.
Identity Parser
A parser used to validate namespaced IDs.
Parameters
registry: (string) Optional. The registry of this namespaced ID. Can be one of:$advancements: All available advancements.$functions: All available functions.$loot_tables: All available loot tables.$predicates: All available predicates.$recipes: All available recipes.$storages: All available recipes.$tags/blocks: All available block tags.$tags/entity_types: All available entity type tags.$tags/fluids: All available fluid tags.$tags/functions: All available function tags.$tags/items: All available item tags.$objectives: All available scoreboard objectives.$teams: All available teams.- Other strings should be treated as the name of a built-in registry which can be found in the
registry.jsonfile generated by the data generator.
values: (object) Optional. All possible IDs that can be put in this string.allowTag: (boolean) Optional, defaults tofalse. If set totrue, an ID starting with#under the corresponding registry should be accepted.allowUnknownValue: (boolean) Optional, defaults tofalse. If set totrue, IDs that don't exist in neitherregistrynorvalueswon't be reported as errors.
NbtPath Parser
A parser used to validate NBT paths.
Nbt Parser
A parser used to validate NBT tags.
Parameters
type: (NbtNodeTypeName|NbtNodeTypeName[]) The type of this NBT tag.category: (minecraft:block|minecraft:entity|minecraft:item) The type of this NBT.id: (string) Optional. An ID in the specific category.isPredicate: (boolean) Optional, defaults tofalse. Whether this NBT is in a predicate or not.
Objective Parser
A parser used to validate scoreboard objectives.
TranslateKey Parser
A parser used to validate translation keys in resource packs.
Vector Parser
A parser used to validate number vectors.
Parameters
dimension: (number) The dimension of the vector.allowLocal: (boolean) Optional, defaults totrue. Whether local coordinates are acceptable.allowRelative: (boolean) Optional, defaults totrue. Whether relative coordinates are acceptable.
File Struture
src: Stores all JSON Schemas.shared: Stores all common JSON Schemas.tags: Stores JSON Schemas for tags.advancement.json: JSON Schema for advancements.loot_table.json: JSON Schema for loot tables.pack.mcmeta.json: JSON Schema forpack.mcmeta.predicate.json: JSON Schema for predicates.recipe.json: JSON Schema for recipes.
utils: Stores useful tools.convert.js: Convertregistries.jsongenerated by Minecraft data generator tosharedfiles.
Special Thanks
This work is based on Levertion/minecraft-json-schema created by @Levertion which is released under a CC BY 4.0 license. I keep it updated with Minecraft.
Contributing
Contributions are welcome!
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago