Hi, how do I get lapis lazuli as a material? Code:java ItemStack stackToCheckFor = new ItemStack(Material."lapis", 10);if(player.getInventory().contains(stackToCheckFor)) {player.getInventory().remove(stackToCheckFor); IS there another way to add lapis lazuli?
Nothing happens! The heal spell should be activated and the lapis should be gone but it does not work Code:java private List<String> cantDoCommand11 =new ArrayList<>();@EventHandlerpublic void onInteract11(final AsyncPlayerChatEvent event){ if(event.getPlayer().getItemInHand().getType()==Material.BOOK){ Player player = event.getPlayer();ItemStack stackToCheckFor = new ItemStack(Material.INK_SACK, 1, (byte)4);if(player.getInventory().contains(stackToCheckFor)) { final String name = player.getName();final String message = event.getMessage();if (message.trim().equalsIgnoreCase("Consano")){if (cantDoCommand11.contains(name)){event.setCancelled(true);return;}if(player.hasPermission("Venificus.Consano") || player.getPlayer().isOp()){player.getInventory().remove(stackToCheckFor);player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 100, 2));cantDoCommand11.add(name);new BukkitRunnable(){@Overridepublic void run(){cantDoCommand11.remove(name);}}.runTaskLater(plugin, 0); }}}}}
In your code above, you're checking for exactly one of the lapis. Is that what you have as a stack in your inventory? klofno1
turqmelon I am sorry, it does not work! Somehow there is something wrong with selecting 'Lapis lazuli'.