Json Entity Models for Minecraft (Not MCPatcher Format)

Related tags

JSON JsonEM
Overview

JsonEM (Json Entity Models)

Library for modders, resource pack makers, and modpack makers to create and edit entity models WITH JSON
Does not work with OptiFine format!

Generate Vanilla/Mods' Entity Models:

If you'd like to dump json-ified versions of all entity models (vanilla or modded) so that you can edit them easily with resource packs or use them as examples, here's how:

  • Launch the game, and then open the configuration file located at .minecraft/config/jsonem.properties.
  • Edit the second line of the file to be dump_models=true.
  • Re-launch the game. Navigate to the folder .minecraft/jsonem_dump.
  • Within this folder you should find all registered entity models dumped as json, formatted like a resource pack.
  • Use this format when editing or adding models with a resource pack.

For Resource Pack/Modpack Makers:

  • Complete the steps above to dump all entity models from your game or modpack.
  • When editing your resource pack/modpack resources, add entity model json files as they are formatted in the dumped model folder.

For Modders:

JsonEM can be used to create TexturedModelData for your entities entirely using json.
This guide will demonstrate how to make the model for the cube entity in this tutorial with json.

  • Include the mod as follows:
TBD
  • Register the entity model layer for your entity through JsonEM instead of Fabric API (Excludes the need for a code-generated TexturedModelData)
void onInitializeClient() {
    [...]
    JsonEM.registerModelLayer(MODEL_CUBE_LAYER);
}
  • Add a model file to your mod resources containing your entity's model data
    EX: assets/my_mod/models/entity/my_entity/layer.json
{
    "texture": {
        "width": 64,
        "height": 64
    },
    "bones": {
        "cube": {
            "transform": {
                "origin": [0, 0, 0]
            },
            "cuboids": [
                {
                    "uv": [0, 0],
                    "offset": [-6, 12, -6],
                    "dimensions": [12, 12, 12]
                }
            ]
        }
    }
}
  • Make sure that the bone "cube" in the file above is being accessed with the same name in your entity model
public CubeEntityModel(ModelPart modelPart) {
    this.base = modelPart.getChild("cube"); // The original tutorial used an unspecified field called EntityModelPartNames.CUBE
}
You might also like...

A Java serialization/deserialization library to convert Java Objects into JSON and back

Gson Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to a

Jan 8, 2023

High-performance JSON parser

High-performance JSON parser

HikariJSON A High-performance JSON parser. HikariJSON is targeted exclusively at Java 8. If you need legacy support, there are several decent librarie

Dec 31, 2022

Screaming fast JSON parsing and serialization library for Android.

Screaming fast JSON parsing and serialization library for Android.

#LoganSquare The fastest JSON parsing and serializing library available for Android. Based on Jackson's streaming API, LoganSquare is able to consiste

Dec 18, 2022

A modern JSON library for Kotlin and Java.

Moshi Moshi is a modern JSON library for Android and Java. It makes it easy to parse JSON into Java objects: String json = ...; Moshi moshi = new Mos

Dec 31, 2022

A fast JSON parser/generator for Java.

A fast JSON parser/generator for Java.

fastjson Fastjson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON str

Dec 31, 2022

JSON query and transformation language

JSLT JSLT is a complete query and transformation language for JSON. The language design is inspired by jq, XPath, and XQuery. JSLT can be used as: a q

Dec 30, 2022

Sawmill is a JSON transformation Java library

Sawmill is a JSON transformation Java library

Update: June 25, 2020 The 2.0 release of Sawmill introduces a breaking change to the GeoIpProcessor to comply with the updated license of the MaxMind

Jan 1, 2023

Compare JSON in your Unit Tests

JsonUnit JsonUnit is a library that simplifies JSON comparison in tests. APIs AssertJ integration Hamcrest matchers Spring MVC assertions Spring WebTe

Dec 29, 2022

Genson a fast & modular Java Json library

Genson Genson is a complete json - java conversion library, providing full databinding, streaming and much more. Gensons main strengths? Easy to use

Jan 3, 2023
Comments
  • Infinite resource loading incompatibility with Waystones mod

    Infinite resource loading incompatibility with Waystones mod

    Same issue as https://github.com/FoundationGames/Automobility/issues/16 and https://github.com/ModdingForBlockheads/Waystones/issues/637

    Having JsonEM installed alongside Waystones and it's dependencies Balm/Cloth Config causes an infinite resource loading loop.

    Balm 3.2.0 Cloth Config 6.4.90 Fabric API 0.59.1 JsonEM 0.1.2 Waystones 10.1.0 Minecraft 1.18.2 Fabric Loader 0.14.10

    logs

    opened by ProfanedBane 0
  • Deleting vanilla parts makes the game unable to apply the resource pack

    Deleting vanilla parts makes the game unable to apply the resource pack

    So, I tried to delete a vanilla part in an entity model, and when I was going to test the resource pack models, the game was unable to reload resource packs, and a notification popped in the top-right corner of the screen. I don't know if this is intentional, but if it isn't, please fix this because it's annoying.

    opened by pessoacasual12 0
  • CurseForge upload

    CurseForge upload

    This mod seems really interesting and ~with the high possibility to be added in the convertible mods of MCPP++~ since it's confirmed in the to-do list of MCPP++, it would be a nice replacement-addition in Fabulously Optimized. Also it would benefit the CurseForge launcher users since they’re unable to use non-CurseForge mods.

    opened by RaptaG 0
  • Changing additional models does not work

    Changing additional models does not work

    It seems like JsonEM is unable to apply custom models on entity overlays such as armor or saddles. Any ways to fix that in curent mod version? Is it planned to be added?

    opened by shizotoaster 0
Owner
null
MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJO to JSON in a declarative way.

MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJ

Andrei Ciobanu 59 Sep 17, 2022
A compiler built in Java that allows to translate xml format to json.

A compiler built in Java that allows to translate xml format to json. Getting Started Welcome to the VS Code Java world. Here is a guideline to help y

Víctor Andrés Rojas 1 Jan 6, 2022
JSON to JSON transformation library written in Java.

Jolt JSON to JSON transformation library written in Java where the "specification" for the transform is itself a JSON document. Useful For Transformin

Bazaarvoice 1.3k Dec 30, 2022
Generate Java types from JSON or JSON Schema and annotates those types for data-binding with Jackson, Gson, etc

jsonschema2pojo jsonschema2pojo generates Java types from JSON Schema (or example JSON) and can annotate those types for data-binding with Jackson 2.x

Joe Littlejohn 5.9k Jan 5, 2023
Essential-json - JSON without fuss

Essential JSON Essential JSON Rationale Description Usage Inclusion in your project Parsing JSON Rendering JSON Building JSON Converting to JSON Refer

Claude Brisson 1 Nov 9, 2021
A simple java JSON deserializer that can convert a JSON into a java object in an easy way

JSavON A simple java JSON deserializer that can convert a JSON into a java object in an easy way. This library also provide a strong object convertion

null 0 Mar 18, 2022
A 250 lines single-source-file hackable JSON deserializer for the JVM. Reinventing the JSON wheel.

JSON Wheel Have you ever written scripts in Java 11+ and needed to operate on some JSON string? Have you ever needed to extract just that one deeply-n

Roman Böhm 14 Jan 4, 2023
Packable is an effective data interchange format.

Packbele 中文文档 1. Overview Packable is a well designed data interchange format. It has been impleamented multiple languages , which is effective and ea

Billy Wei 26 Sep 20, 2022
Uber-project for (some) standard Jackson textual format backends: csv, properties, yaml (xml to be added in future)

Overview This is a multi-module umbrella project for Jackson standard text-format dataformat backends. Dataformat backends are used to support format

FasterXML, LLC 351 Dec 22, 2022
High performance JVM JSON library

DSL-JSON library Fastest JVM (Java/Android/Scala/Kotlin) JSON library with advanced compile-time databinding support. Compatible with DSL Platform. Ja

New Generation Software Ltd 835 Jan 2, 2023