Skip to content

JSON file generation inconsistencies #33

Description

@b0xfox

MCB version 4.1.1 -- Pack Format: 61

There is one parsing edge case and one inaccuracy when using the damage_type and worldgen JSON generation keywords.

Generating worldgen files with nested, multi-line json data causes compiler error

Note: This is the only file generation keyword that I've used and encountered this issue.

Steps to reproduce

Add this text to a .mcb file:

worldgen biome example{
    "carvers": [],
    "downfall": 0.4,
    "effects": {
        "fog_color": 12638463,
        "music_volume": 1,
        "sky_color": 7907327,
        "water_color": 4159204,
        "water_fog_color": 329011
    },
    "features": [],
    "has_precipitation": true,
    "spawn_costs": {},
    "spawners": {},
    "temperature": 0.8
}

Expected: Json file is generated normally.
Result: Compiler Error: Unexpected extra data in json tag

Work around:
Flattening the nested data into a single line resolves the issue:

worldgen biome example{
    "carvers": [],
    "downfall": 0.4,
    "effects": { "fog_color": 12638463, "music_volume": 1, "sky_color": 7907327, "water_color": 4159204, "water_fog_color": 329011 },
    "features": [],
    "has_precipitation": true,
    "spawn_costs": {},
    "spawners": {},
    "temperature": 0.8
}

World gen + mcb isn't a common situation, so mostly mentioning for work around awareness.


Damage type files are generated under /damage instead of /damage_type.

Steps to reproduce

Add this text to a .mcb file:

damage_type example{
    "exhaustion": 0,
    "message_id": "generic",
    "scaling": "never"
}

Expected: Json file is generated under datapack/data/namespace/damage_type
Result: Json file is generated under datapack/data/namespace/damage

Work around:
You can use relative paths to re-create the correct directory:

damage_type ../damage_type/example{
    "exhaustion": 0,
    "message_id": "generic",
    "scaling": "never"
}

Not a big deal either. Just making an issue for awareness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions