Перейти к содержимому
Mineforgian

Codec2Schema

A tool to convert codecs to JSON schemas.

Загрузки
1K
Подписчики
4
Обновлён
18 августа 2026 г.
Лицензия
MIT

Опубликован 27 декабря 2025 г.

Codec2Schema

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

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 <YOUR GAME DIRECTORY>/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.

Ченджлог

0.3.7+1.21.11Релиз1.21.11 · 18 августа 2026 г.

Added

  • Added an option to export plugin info (ids, versions, exported schemas, etc.)

Changed

  • The game version in exported info now uses the internal name instead of the display name
0.3.7+26.1.2Релиз26.1.1, 26w14a, 26.1.2 · 18 августа 2026 г.

Added

  • Added an option to export plugin info (ids, versions, exported schemas, etc.)

Changed

  • The game version in exported info now uses the internal name instead of the display name
0.3.7+26.3-snapshot-9Бета26.3-snapshot-9 · 18 августа 2026 г.

Update to 26.3-snapshot-9

0.3.7+26.3-snapshot-8Бета26.3-snapshot-8 · 13 августа 2026 г.

Update to 26.3-snapshot-7

Added

  • Added an option to export plugin info (ids, versions, exported schemas, etc.)

Changed

  • The game version in exported info now uses the internal name instead of the display name
0.3.7+26.2Релиз26.2 · 13 августа 2026 г.

Added

  • Added an option to export plugin info (ids, versions, exported schemas, etc.)

Changed

  • The game version in exported info now uses the internal name instead of the display name
0.3.6+26.3-snapshot-6Бета26.3-snapshot-6, 26.3-snapshot-7 · 29 июля 2026 г.

Update to 26.3-snapshot-6

0.3.6+26.3-snapshot-5Бета26.3-snapshot-5 · 22 июля 2026 г.

Update to 26.3-snapshot-5

Changes

  • Re-enabled support for Fabric Model Loading API

Fixes

  • Fixed wrong codec being exported for minecraft:recipe
0.3.6+26.3-snapshot-4Бета26.3-snapshot-4 · 17 июля 2026 г.

Update to 26.3-snapshot-4

Changes

  • Temporarily disabled support for Fabric Model Loading API

Комментарии

Загружаем…