#Hide mod in JEI with exceptions
8 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
I wrote an example script for this.
Give me a second to find it
[Quote ➤](#1052431812317696040 message) A simple script that can help declutter the REI menu when Chipped is installed.
It works by finding all minecraft items that contain a chipped tag and creating an REI grouping for that tag.
function replaceAll(string, find, replace) {
return string.replace(new RegExp(find, 'g'), replace)
}
function getNameOfID(id) {
let output = "";
id = replaceAll(id, ":", " ");
id = replaceAll(id, "_", " ");
let parts = id.split(" ");
for (let i = 0; i < parts.length; i++) {
output += parts[i].substring(0, 1).toUpperCase() + parts[i].substring(1);
if (i < parts.length - 1) {
output += " ";
} else {
output += "s";
}
}
return output;
}
onEvent('rei.group', (event) => {
Ingredient.of('@minecraft').getItemIds().forEach((id) => {
let name = getNameOfID(id);
id = id.replace('minecraft:', 'chipped:');
let parts = id.split(':');
event.groupItemsByTag(`kubejs:rei_groups/${parts[0]}/${parts[1]}`, name, id);
});
let terracottas = ['minecraft:terracotta'];
for(let i=1; i<=66; i++){
terracottas.push('chipped:terracotta_'+i);
}
event.groupItems('kubejs:reigroups/chipped/terracotta', getNameOfID('minecraft:terracotta'), terracottas);
});
Oh wait this is JEI, not REI grouping
Well, you could probably take this script, and change it so that you hide those tags, rather than group them by tags
@bronze escarp Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!
No solution was provided. For anyone looking for this in the future, my plan is to use a complex regex to remove all chipped items from JEI with the exception of blocks that include specific keywords like "bench". The idea is that it will leave the bench recipes searchable as well as a single block of each type to illustrate which blocks can be modified in the benches. Note that this approach will only work in Chipped 1.19.2 and above, as it relies on the new block IDs which are now unique rather than the old naming convention of block_type_## used in 1.18.2 and earlier. Doing something similar in an earlier version may be possible by including a specific number in the regex instead of a keyword, but would likely require some experimentation.
Here's an example regex:
/^chipped:(?!.*bench|.*table|chiseled_quartz).*/```