#help removing jei/recipe/items by a specific part of their data

36 messages · Page 1 of 1 (latest)

chilly glacier
#

looking to hide guns / remove recipes / etc from base tacz but leave the ones from Create Armory, how do i go about using the GunId in the custom_data?"

tender havenBOT
#

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

knotty raptor
#
RecipeViewerEvents.removeEntries('item', event => {
  event.remove(stack => {
    if (stack.id != "tacz:modern_kinetic_gun") return false
    let nbt = stack.getCustomData()
    let gunId = nbt.get("GunId")
    if (gunId == null) return false
    if (gunId.getAsString() == "create_armorer:pistol_auto_stress") return true
    return false
  })
})

@chilly glacier try this

chilly glacier
#

hmm doesnt seeem like its working. no errors but not hiding anything

#

i probably also if possible want to use #create_armorer if that applies to data like that too

#

i also need to find the 1.21 way of like full deleting items from crafting too

knotty raptor
#

no, can't use tags

#

@chilly glacier are you placing this at client_scripts ?

#
RecipeViewerEvents.removeEntries('item', event => {
  event.remove(stack => {
    if (stack.id != "tacz:modern_kinetic_gun") return false
    console.log("Item is: " + stack.id)
    let nbt = stack.getCustomData()
    console.log("CustomData is: " + nbt)
    let gunId = nbt.get("GunId")
    console.log("GunId is: " + gunId)
    if (gunId == null) return false
    if (gunId.getAsString() == "create_armorer:pistol_auto_stress") return true
    return false
  })
})
#

@chilly glacier try now and see if it prints some stuff

chilly glacier
#

oh wait the create one is removed now

#

thats the exact opposite of what i want to happen

knotty raptor
#

👀

chilly glacier
#

ok so i just add a ! on the last check there and turn it into a list of every create gun?

#

is getAsString() gonna take a [bunch of things] or no

knotty raptor
#

no

chilly glacier
#

its elif time?

#

the dark and sinister coding method

knotty raptor
#

@chilly glacier what do you really want? I'm hiding the Create one
you actually want to show ONLY create?

chilly glacier
#

im looking to show only the ones from create_armorer

knotty raptor
#

MOD or that item specifically?

#

pistol_auto_stress

#

@chilly glacier so you want to hide everything but from create_armorer MOD ?

chilly glacier
#

its a mod but all 12 of the guns use that format of the item being just tacz:modern_kinetic_gun and the ids have the actual gun name

#

so do i wanna uhhh if("create_armorer" in gunId)

#

or rather if !("create_armorer" in gunId) return true;

knotty raptor
#

answer me

chilly glacier
#

yes everything but from the Create Armorer mod

knotty raptor
#
RecipeViewerEvents.removeEntries('item', event => {
  event.remove(stack => {
    if (stack.id != "tacz:modern_kinetic_gun") return false
    console.log("Item is: " + stack.id)
    let nbt = stack.getCustomData()
    console.log("CustomData is: " + nbt)
    let gunId = nbt.get("GunId")
    console.log("GunId is: " + gunId)
    if (gunId == null) return false
    if (ID.namespace(gunId.getAsString()) != "create_armorer") return true
    return false
  })
})
#

@chilly glacier try

chilly glacier
#

works perfect, now i gotta remove the ability to craft all the removed guns

chilly glacier
#

can i just change it to RecipeViewerEvents.removeEntriesCompletely? does that like remove all recipes for each item

#

the wiki does uhhh not explain what the difference is

knotty raptor
#

you can test, but even if you manage to do it, it won't prevent people from crafting it

#

you really need to remove the recipe via ServerEvents