// 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);
});
});
#How can i make this work?
27 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
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
Not possible atleast not with to startups
it is
const originalTag = "forge:dusts/wood";
const tag = "#" + originalTag;
const replacement = "thermal:sawdust";
var tags = [];
``` it works with this
You can't get Tags during the Tag event
Tags aren't initialized yet
What even is the error
[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
pretty sure the KJS tag even runs last
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
Could be, i think the was a time where this didn't work could be that this changed
╰( ͡° ͜ʖ ͡° )つ──☆:・゚˜”°•.˜”°• 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.
Basically asking what's the Error Happening/ what you See Happening
thermal:niter_dust is supposed to have all those 3 tags, and immersiveengineering:dust_saltpeter is supposed to have none
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
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