I am getting a NPE (null-pointer exception) when placing any other item than the ones I have defined, or when drinking from a milk-bucket. I have tried adding isCanceled() == false to my EventHandler, but it breaks my RIGHT_CLICK_AIR action. Sorry, it sounds kind of complicated, any more info can be provided, thanks in advance!
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerInteract(PlayerInteractEvent event) {
Player p = event.getPlayer();
Location location = p.getLocation();
ItemStack item = event.getItem();
if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK && event.hasItem() != false || event.isCancelled() == true) {