#How can i make this work?

27 messages · Page 1 of 1 (latest)

thin robin
#
// priority: 1

ServerEvents.tags("item", event => {
    const originalTag = "forge:dusts/niter";
    const tag = "#" + originalTag;
    const replacement = "thermal:niter_dust";
    var tags = [];

    Ingredient.of(tag).itemIds.forEach(tagItem => {
        var tagItemTags = Item.of(tagItem).getTags().toArray();

        tagItemTags.forEach(tagId => {
            var tagString = tagId.toString();
            var tag = tagString.substring(tagString.indexOf('/') + 2, tagString.indexOf(']'));

            tags.push(tag);
        });
    });
    event.get(originalTag).removeAll();
    tags.forEach(itag => {
        event.add(itag, replacement);
    });
});
hardy cobaltBOT
#

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

peak pendant
#

what is this even supposed to do

thin robin
#

for every item in #forge:dusts/niter that isn't thermal:niter_dust, gather all the tags, remove the tags from all of them, and apply them to thermal:niter_dust

foggy cave
#

Not possible atleast not with to startups

thin robin
#

it is

#
    const originalTag = "forge:dusts/wood";
    const tag = "#" + originalTag;
    const replacement = "thermal:sawdust";
    var tags = [];
``` it works with this
foggy cave
#

You can't get Tags during the Tag event

#

Tags aren't initialized yet

#

What even is the error

thin robin
#
[20:47:29] [INFO] OreDict.js#20: forge:dusts
[20:47:29] [INFO] OreDict.js#20: forge:dusts/wood
[20:47:29] [INFO] OreDict.js#20: forge:sawdust
``` i quite literally have
peak pendant
thin robin
#

and the idea is to unify item tags

#

2 different items that represent the same thing can have different tags and if you unify them some recipes might be broken because the recipe requires a tag that isn't available in the unified version of the item

foggy cave
bright capeBOT
#

╰( ͡° ͜ʖ ͡° )つ──☆:・゚˜”°•.˜”°• Many Help •°”˜.•°”˜*
Please provide a description of your issue with as much detail as possible. If you have an issue with a script provide the script. Explain what you can see happening and what you expect to happen. Be specific!

Tell us what is happening, we already know it "doesn't work".
Avoid using words like "it", tell us exactly what "it" is.
Don't assume anyone knows what you are talking about, be specific.

Provide screenshots or video of the issue if possible.

Provide the log.

foggy cave
#

Basically asking what's the Error Happening/ what you See Happening

thin robin
#

thermal:niter_dust is supposed to have all those 3 tags, and immersiveengineering:dust_saltpeter is supposed to have none

foggy cave
#

Yeah that Happens because you're only looking for items that have the Tag niter but immersive doesn't have that so nothing is changed

thin robin
#

oh yeah i fixed it now

#
// priority: 1

ServerEvents.tags("item", event => {
    event.add("forge:dusts/niter", "immersiveengineering:dust_saltpeter");
    event.add("forge:dusts", "immersiveengineering:dust_saltpeter");
});

ServerEvents.tags("item", event => {
    const originalTag = "forge:dusts/niter";
    const tag = "#" + originalTag;
    const replacement = "thermal:niter_dust";
    var tags = [];

    Ingredient.of(tag).itemIds.forEach(tagItem => {
        var tagItemTags = Item.of(tagItem).getTags().toArray();

        tagItemTags.forEach(tagId => {
            var tagString = tagId.toString();
            var tag = tagString.substring(tagString.indexOf('/') + 2, tagString.indexOf(']'));

            tags.push(tag);
        });
    });

    tags.forEach(itag => {
        event.removeAll(itag);
        event.add(itag, replacement);
    });
});
#

ofc im gonna pack it all into a function

#

danke

#

it works now