#Showing recipes from JEI after hiding them

13 messages · Page 1 of 1 (latest)

native bolt
#

So, I was looking in other supports and example scripts and haven't found anything like what I'm trying to do. So, any sugestions? I have some code right here, but this doesn't work on what I was thinking (sorry if I misspelled something, english isn't my first language, or if I posted)

To summarize: I want to have some hidden items (and recipes) in JEI, and if the player make them by accident the recipe appears in JEI

JEIEvents.hideItems(e =>{
    hideAll.forEach(ctx => {
        e.hide(ctx)
    });
  })

JEIEvents.removeRecipes(e =>{
    hideAll.forEach(ctx => {
        e.hide(ctx)
    });
  })

ItemEvents.crafted(e => {
  craftedItem = e.getItem().getId()

  if (hideAll.includes(craftedItem)){
    e.filter(i => i !== craftedItem)
  }
})

const hideAll = [
    hideDiamond,
    hideNetherite
]

const hideDiamond = [
  'minecraft:diamond_sword',
  'minecraft:diamond_axe',
  'minecraft:diamond_pickaxe',
  'minecraft:diamond_shovel',
  'minecraft:diamond_hoe'
]

const hideNetherite = [
    'minecraft:netherite_sword',
    'minecraft:netherite_axe',
    'minecraft:netherite_pickaxe',
    'minecraft:netherite_shovel',
    'minecraft:netherite_hoe'
]
rancid larkBOT
#

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

native bolt
#

did somemore diging, come up with this, again, not working

let receitas_itemOcultos = [
  'minecraft:diamond_sword',
  'minecraft:diamond_axe',
  'minecraft:diamond_pickaxe'
]

JEIEvents.hideItems(e => {
  receitas_itemOcultos.forEach(id => e.hide(id))
})

JEIEvents.removeRecipes(e => {
  receitas_itemOcultos.forEach(id => e.remove(id))
})

ItemEvents.crafted(event => {
  const itemCraftado = event.item.id

  if (itemCraftado.includes(receitas_itemOcultos)){
    receitas_itemOcultos = receitas_itemOcultos.filter(itemCraftado)
  }
})
fierce flower
#

not sure if integrated jei events do support this

#

but certainly the jei api does, check in global.jeiruntime

native bolt
#

sorry for the late response, I thought this ticket was dead lol

native bolt
#

thanks

fierce flower
#

No worries, let me know if you need further help

#

@native bolt just figured, what if you use the AStages mod: restrict the item so its only not shown in jei and revoke the restriction on craft

native bolt
#

Fyi i was doing something similar, because I was thinking hiding in jei wasn't gonna work

#

When I get back home i'll post here