This is the code I have right now but it dosen't seem to be working. Code (Text): @EventHandler public void FireWorkLaunch (PlayerInteractEvent e) { Player p = e.getPlayer(); if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (p.getItemInHand().equals(Material.FIREWORK) && (p.getItemInHand().getItemMeta().getDisplayName().contains("Kangaroo"))) { e.setCancelled(true); return; } } }
You do not want to do .equals you should do: Code (Text): public void fireWorkLaunch(PlayerInteractEvent e) { Player p = e.getPlayer(); if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (p.getItemInHand().getType() == Material.FIREWORK && p.getItemInHand().getItemMeta().getDisplayName().contains("Kangaroo")) { e.setCancelled(true); return; } } }