Skip to content
This repository was archived by the owner on Aug 16, 2020. It is now read-only.
/ datapack-json Public archive

[Deprecated. See https://github.com/misode/minecraft-schemas for an alternative.] A VSCode extension and NPM package providing JSON schemas for Minecraft: Java Edition datapack JSON files.

License

Notifications You must be signed in to change notification settings

SPGoding/datapack-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fb27cde · Aug 15, 2020
Jul 6, 2020
Apr 13, 2020
Apr 29, 2020
Aug 15, 2020
Sep 21, 2019
Sep 21, 2019
Sep 21, 2019
May 13, 2020
Jul 14, 2019
Sep 22, 2019
Jul 7, 2020
Jul 14, 2019
Aug 15, 2020
Jul 14, 2019
Aug 15, 2020
Aug 15, 2020

Repository files navigation

DEPRECATED

DEPRECATED

DEPRECATED

DEPRECATED

DEPRECATED

This package is now deprecated, please install this VS Code extension as a replacement. The alternative VS Code extension can provide far better support for data pack JSONs. (I created both extensions, btw.)

If you're a programmer who's interested in the schemas, I'd suggest you take a look at this.

DEPRECATED

DEPRECATED

DEPRECATED

DEPRECATED

DEPRECATED


CircleCI npm

License semantic-release Gitmoji

Installation

npm i datapack-json

Custom 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 to true.

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 to false. 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.json file generated by the data generator.
  • values: (object) Optional. All possible IDs that can be put in this string.
  • allowTag: (boolean) Optional, defaults to false. If set to true, an ID starting with # under the corresponding registry should be accepted.
  • allowUnknownValue: (boolean) Optional, defaults to false. If set to true, IDs that don't exist in neither registry nor values won'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 to false. 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 to true. Whether local coordinates are acceptable.
  • allowRelative: (boolean) Optional, defaults to true. 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 for pack.mcmeta.
    • predicate.json: JSON Schema for predicates.
    • recipe.json: JSON Schema for recipes.
  • utils: Stores useful tools.
    • convert.js: Convert registries.json generated by Minecraft data generator to shared files.

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!

About

[Deprecated. See https://github.com/misode/minecraft-schemas for an alternative.] A VSCode extension and NPM package providing JSON schemas for Minecraft: Java Edition datapack JSON files.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published