#Can't seem to add json to assets with ClientEvents.highPriorityAssets

24 messages · Page 1 of 1 (latest)

urban sorrel
#

Trying to dynamically create some json files in an asset folder so that the mod MoreCreativeTabs can read them.

This is my code. I get no errors but it does not seem to affect anything in the mod.

ClientEvents.highPriorityAssets(event => {
    console.log('Customizing creative tabs...');
    event.add('minecraft:morecreativetabs/disabled_tabs.json', {
        "disabled_tabs": [
            "brewing",
            "decorations"
        ]
    });

    event.add('minecraft:morecreativetabs/building_blocks.json', {
        "tab_enabled": true,
        "tab_name": "building_blocks",
        "replace": true,
        "tab_stack": {
            "name": "minecraft:rail"
        },
        "tab_items": [
            {
                "name": "minecraft:soul_torch",
                "nbt": "{customName: \"Oi Govener!\"}"
            }
        ]
    });
});

stoic martenBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

neon cosmos
#

no file extensions, it'll add the .json itself

urban sorrel
#

Tried that now, still not doing anything. Is there any way I can see if it was generated correctly during runtime?

neon cosmos
#

in <minecraft>/local/kubejsdev.properties try setting dataPackOutput to true

urban sorrel
#

Does that work for assets as well

#

since I am generating assets and not data

urban sorrel
#

Where would it generate? I checked in "kubejs/assets/minecraft/morecreativetabs". Nothing in there

neon cosmos
#

it wont generate physical files, that flag should have it show what's it's doing in the logs

urban sorrel
#

oh lol. My bad. I thought it would since it was the only one not named log but output instead 😛

#

ok lets check the log

neon cosmos
#

does look like it's only used on the server side data events though.... so maybe not

urban sorrel
#

Yea no output except what I already had

neon cosmos
#

have you tried actual hard files in kubejs/assets/minecraft/morecreativetabs? does it work then?

urban sorrel
#

Yes it works fine. Just trying to avoid writing many thousands of lines 😛

#

Faster to generate

neon cosmos
#

hmmm, that is a conundrum

urban sorrel
#

I dont know if it has something to do with me using "event.add()" that is available in the client event, instead of "event.addJson()" that is in the server side variant

urban sorrel
#

I thought it might be the mod not reading the file properly due to them maybe generating later. But even if I reload the mod using the "/mct reloadTabs" command that it provides, it wont work.

urban sorrel
#

Do assets generated during runtime get placed in a (virtual) location with a proper pack.mcmeta file?

stoic martenBOT
#

@urban sorrel Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!