#Hiding items in JEI

18 messages · Page 1 of 1 (latest)

grand star
#

Feeling dumb, I'm trying to learn how hide items in JEI, following an example in another post I found via search but it's not working

`JEIEvents.hideItems(event => {

function hideJEI(listOfItems) {
listOfItems.forEach(item => {
event.hide(item)
});

}

hideJEI([
"minecraft:iron_ingot"
])

})`

reload, no errors, iron ingot still shown in JEI

sorry for dumb question but I just don't get it

jaunty tigerBOT
#

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

grand star
#

the .js is in the kubejs\client_scripts folder too

#

I'd search more posts in this channel but discord is bugged right now and if I scroll at all in the search results it clears my search 😭

charred garden
#

you are making stuff wrong, actual javascript code

#
  JEIEvents.hideItems((event) => {
    hideJEI(event, ["minecraft:iron_ingot"])
  })

  function hideJEI(event, listOfItems) {
    listOfItems.forEach(item => event.hide(item))
  }

please, define your functions outside the event, and you need to pass the event as argument so it can access

grand star
#

Ok I think I understand, this makes way more sense

unfortunately it still does not work, I did some digging through the log and discovered this:

[Render thread/ERROR]: #1: Error loading KubeJS script: client_scripts:hide removed recipes.js': ReferenceError: "JEIEvents" is not defined. (client_scripts:hide removed recipes.js#1)

but I definitely have JEI installed so I'm not sure what's going on

charred garden
#

which kubejs version do you have?

grand star
#

kubejs-fabric-1902.6.1-build.337.jar

#

running jei-1.19.2-fabric-11.6.0.1016.jar for JEI

charred garden
#

do you have ProbeJS to aid you with scripts autocompletion?

grand star
#

nope

I'll install that and the extension and see what happens, maybe the mouseover will tell me something

charred garden
#

??kjsaddons

heavy gazelleBOT
# charred garden ??kjsaddons

ProbeJS is an addon mod for KubeJS that generates typings files for VSCode, allowing VSCode to offer autocompletions for a ton of things!

Mod by @unreal fractal

charred garden
heavy gazelleBOT
grand star
#

ahh bummer

#

ok well thank you for your help!!!