#How can I remove a tag of all items of a specific mod

25 messages · Page 1 of 1 (latest)

vital badger
#

I'm having issues with a tag that when I get the item from it, I get the wrong item, in this case, I get the industrialforegoing gear when I need the thermal series one

ServerEvents.recipes(event => {
  const gears = event.findRecipes({output: "#forge:gears"})
  const ingots = Ingredient.of("#forge:ingots").itemIds
  const metals = []
  ingots.forEach((ingot, index) => {
    var metal = ingot.match(/:(.*?)(_|$)/)
    metals.push(metal[1])
  })
  gears.forEach(gear => {

    event.remove({id: gear.getOriginalRecipe().getId()})  
  })
  metals.forEach((metal,index) => {
    //console.log(metal ,index)
    console.log(Item.of(`#forge:gears/${metal}`))
      try {
        event.recipes.create.deploying(Item.of(`#forge:gears/${metal}`).getId(), [ingots[index], "thermal:press_gear_die"]).keepHeldItem()
        //addDeployCraftByTag(ingot, "thermal:press_gear_die", `#forge:gears/${metal[1]}`)
      } catch(err) {
        console.error("not possible to create gear recipe with: " + metal)
      }
  })
})```
charred hazelBOT
#

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

wispy lotus
#

you dont want to use tags for outputs... ever

#

they are mostly used for input only

#

but for tag related stuff:

supple orchidBOT
#

You can modify tags with KubeJS, and the wiki has a page on that!

vital badger
#

its a lot of items ç-ç

#

but ill try a different aproach

vital badger
#

Can I get all the ids of tag, filter the mod and remove the tag?

wispy lotus
#

"ids of tag" what do you mean?

#

you mean a list of all tags?

fleet edge
#

if I understand wym

vital badger
#

Yes, and then filter the mod

wispy lotus
#

theyre already using that

#

wait what

vital badger
#

Filter the mod is my strugle 😅

#

Idk if is there any method that do this

wispy lotus
#
let items = Ingredient.of('#tag').itemIds.map(i => i.startsWith('create:'))
vital badger
#

Exactly that

wispy lotus
#

its just javascript, everything exists :P

vital badger
#

Ill test it

#

Javascript is not my strong yet 🥲

vital badger
#
const blacklist = [
  "industrialforegoing:gold_gear",
  "industrialforegoing:iron_gear",
  "industrialforegoing:diamond_gear"
]

ServerEvents.tags("item", event => {
  blacklist.map((v,i) => {
    if (v!= null) {
      event.removeAllTagsFrom(v)
    }
  })
})
ServerEvents.recipes(event => {
  blacklist.map((v,i) => {
    if (v!= null) {
      event.remove({output: v})
    }
  })
}
#

that was the solution ty