How to check if an item has a sertain lore? I'm trying to make if lore is something like "Can't drop" then the player can't drop the item. Please help. HELP?? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
If you want to check the first line of the lore you can try something like this: Code:java ItemStack item;if(item.getItemMeta().getLore() != null) if(item.getItemMeta().getLore().get(0).equalsIgnoreCase("loreyouwanttocheck")) { //Code to execute when it has the lore }
Yes, and make sure your listeners are registered EDIT: No sorry it's like this: Code:java ItemStack item = e.getItemDrop().getItemStack();