npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

datapack-json

v2.0.15

Published

Provides JSON validations for Minecraft datapacks.

Downloads

43

Readme

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!