Handling unprotected GUIs - hamza-cskn/obliviate-invs GitHub Wiki
What should we do if we want to make unprotected a slot?
from ultimate claims
Making an icon unprotected
Listen icon and uncancel event.
new Icon().onClick(e -> {
e.setCancelled(false);
})
Disabling protections of all slots
If onClick() returns true, ObliviateInvs does not cancel click event. Also Icon click event triggering after this check. So you can override from icon click event.
@Override
public boolean onClick(InventoryClickEvent e) {
return true;
}
public void anyMethod() {
new Icon(Material.STONE).onClick(e -> e.setCancelled(true))
//always icon click event triggers finally. so you cannot pickup this stone.
}