In short, I have the additional lanterns mod running (adds many different lanterns for all dye colours and materials); and I would like to remove many of the permutations of the lanterns from JEI, and add info to the tooltips of the remaining ones to say that they can be dyed so users know the options exist without them being listed exhaustively. I have a list of colours and materials and removal from JEI works just fine, however I can't seem to get things working when it comes to adding info to the tooltip. The current iteration of the code looks like:
ItemEvents.modifyTooltips(event => {
lantern_mats.forEach(material => {
const itemId = `additionallanterns:${material}_lantern`;
console.log(`Processing: ${itemId}`);
event.modify(itemId, tooltip => {
console.log(`Adding tooltip for: ${itemId}`);
tooltip.add(['Can be dyed']);
});
})
});
And this appears to just be adding the text lantern_mats.size times over to every item in the game. But based on the existing documentation for 1.21 I'm not sure what's going on here.
JS isn't a language I'm too familiar with so there's an element of figuring things out as I go on my part here, but any pointers on the best way to do this would be appreciated.