@EventHandler(priority = EventPriority.HIGHEST) public void event(HangingBreakEvent event) { if (event.getEntity() instanceof ItemFrame || event.getEntity() instanceof Painting) { Hanging hanging = event.getEntity(); if (hanging.hasMetadata(metaFram)) event.setCancelled(true); } }
@EventHandler(priority = EventPriority.NORMAL) public void onHangingBreak(HangingBreakEvent event) { // BlockState Hanging hanging = event.getEntity(); // ItemFrame? if (hanging instanceof ItemFrame) { scs.getShopHandler().removeItemFrame((ItemFrame) hanging); } }