Berry-Club / Genetics-Resequenced

MIT License
1 stars 0 forks source link

Trouble adding custom mob genetics entries #11

Closed MuteTiefling closed 4 months ago

MuteTiefling commented 4 months ago

Following the instructions for adding entity genetics, I have created a kubejs script which should be injecting an entry for a Chococraft Chocobo.

ServerEvents.generateData('before_mods', (event) => {
    let recipes = [
        {
            entity: 'chococraft:chocobo',
            genes: {
                'geneticsresequenced:basic': 5,
                'geneticsresequenced:no_fall_damage': 2,
                'geneticsresequenced:claws': 1,
                'geneticsresequenced:step_assist': 2
            }
        }
    ];

    recipes.forEach((recipe) => {
        // event.json(`enigmatica:geneticsresequenced/entitiy_genes/${recipe.entity.replace(':', '_')}`, recipe);
        event.json(`geneticsresequenced:entitiy_genes/${recipe.entity.replace(':', '_')}`, recipe);
    });
});

I can confirm the virtual data pack is being created in the specified path, but the mobs never seem to get the traits.

I've also attempted loading the json directly via the kubejs Data folder, thus bypassing the script, and it still doesn't appear to give them the traits. Nothing shows for them in EMI and decrypting their genes always comes up as basic.

Is there possibly an issue loading these currently? Mod version: 1.21-1.1.1 Or am I simply doing things wrong?

I've tried, as you can see in the script, a variety of paths. None seem to work. When loaded manually, I placed it here \kubejs\data\geneticsresequenced\entitiy_genes

aaronhowser1 commented 4 months ago

entitiy_genes

MuteTiefling commented 4 months ago

omg, I just saw that too >.<

aaronhowser1 commented 4 months ago

Lmk if it works though I haven't tried using kjs for it yet

MuteTiefling commented 4 months ago

This works great. Amazing what proper spelling will do for you :D

If you want to keep this as an example for people (1.21 only), feel free. <3

ServerEvents.generateData('before_mods', (event) => {
    let recipes = [
        {
            entity: 'chococraft:chocobo',
            genes: {
                'geneticsresequenced:basic': 5,
                'geneticsresequenced:no_fall_damage': 2,
                'geneticsresequenced:claws': 1,
                'geneticsresequenced:step_assist': 2
            }
        }
    ];

    recipes.forEach((recipe) => {
        event.json(`enigmatica:geneticsresequenced/entity_genes/${recipe.entity.replace(':', '_')}`, recipe);
    });
});
aaronhowser1 commented 4 months ago

Very cool, thank you