Skip to content

Codec2Schema

A tool to convert codecs to JSON schemas.

Fabric
Loaders
Fabric
Downloads on Modrinth
2K
Followers on Modrinth
4
versions
51
Updated
October 7, 2026Oct 7
Published
in 2025
This is a library — other mods need it, and it adds nothing to the game by itself

At a glance

A library: other mods need it
Runs on Fabric
For Minecraft 1.21.11–26.3
Works on either side — install it in the game, on the server, or both
Latest version — 0.3.7+26.4-snapshot-3 from October 7, 2026
License MIT — free
Where it's needed
In gameoptionalOn serveroptional

Works both in the game and on the server — install where you need it

Game versions1.21.11–26.3

Codec2Schema

Through the power of mixins, sheer will, and unchecked type casts, this mod transforms codecs into (mostly) usable JSON schemas.

You can find the generated schemas for vanilla Minecraft here.

What is a Codec?

Codecs are Mojang's way of easily serializing data to and from JSON. They define the structure of an object, meaning JSON schemas can be generated from them.

What is a JSON Schema?

A JSON schema is a file that describes how JSON files should be structured, and can be used by IDEs to provide autocomplete when creating or editing JSON files.

About This Mod

When installed, this mod exports JSON schemas for data and resource pack files to `/codec2schema`. You can use the API to export your own codecs as well!

The generated JSON schemas will have autocomplete for registries (items, blocks, etc), including modded content.

This mod is not perfect: there are many edge cases that aren't or can't be accounted for.

Example

The following is the generated JSON schema for regional compliancies warnings:

{
  "$schema": "https://json-schema.org/draft-07/schema",
  "$ref": "#/definitions/def",
  "definitions": {
    "def": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "array",
        "items": {
          "$ref": "#/definitions/def_1"
        }
      }
    },
    "def_1": {
      "type": "object",
      "properties": {
        "delay": {
          "type": "integer",
          "minimum": -9223372036854775808,
          "maximum": 9223372036854775807,
          "default": 0
        },
        "period": {
          "type": "integer",
          "minimum": -9223372036854775808,
          "maximum": 9223372036854775807
        },
        "title": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "period",
        "title",
        "message"
      ]
    }
  }
}

It's not perfect, but it's good enough.

FAQ

How to install Codec2Schema?

Install Fabric for your Minecraft version, download Codec2Schema for the same version and loader, put the file into the mods folder and launch the game with the loader profile.

Which Minecraft versions does Codec2Schema support?

Codec2Schema has builds for Minecraft 1.21.11–26.3.

Is Codec2Schema needed on the server?

Works on either side — install it in the game, on the server, or both

License and source
MIT Licensefree to use and share with credit to the author
Original — Modrinth↗Files unchanged, verified with SHA-512Is this your mod? For rights holders

The site uses cookies: the necessary ones for sign-in and the theme, plus the Yandex Metrica and LiveInternet visit counters — they show us how the site is used. We have no advertising cookies. More