Open gkhaavik opened 3 years ago
in the client event, there is an inventory content instance, so you can use it to put an icon to change the slot. and idk i didn't use the blacklist pattern im not sure.
contents.set(SlotPos.of(1, 0), Icon.click(combatItem, clickEvent -> {
// ENABLE
// Make item glowing
clickEvent.icon().item(ItemStackBuilder.from(combatItem.clone()).glow().itemStack())
.whenClick(clickEvent1 -> {
// DISABLE
// Make item not glowing
clickEvent1.icon().item(combatItem);
});
}));
Like that?
uhm, not exactly, you have to make it in a method that is recursive. also, use the set method, don't change the item itself
Can you give me an example?
I am trying to change the icon item that is clicked, and change it back once pressed again. How would I go about doing that? and also, how does
blacklistPattern()
work?