npm i datapack-json
There are two custom properties for string
schema: parser
and params
, which should be used to validate the content of the string.
A parser used to validate commands.
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
.
A parser used to validate entities.
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.
A parser used to validate namespaced IDs.
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.json
file 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 neitherregistry
norvalues
won't be reported as errors.
A parser used to validate NBT paths.
A parser used to validate NBT tags.
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.
A parser used to validate scoreboard objectives.
A parser used to validate translation keys in resource packs.
A parser used to validate number vectors.
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.
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.json
generated by Minecraft data generator toshared
files.
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.
Contributions are welcome!