Hi,
I'm having trouble to search for a specific item in the players inventory
So I have to search for a specific item which has weird naming (in the picture)
I wrote this but it doesn't work :
ItemStack is = p.getInventory().getItem(i);
if(is != null) {
if(is.getType() == Material.COCOA_BEANS) {
ItemMeta imeta = (ItemMeta) is;
if(is.getAmount() >= prix && imeta.getDisplayName() == monnaie) {
p.getInventory().removeItem(new ItemStack(Material.COCOA_BEANS, prix));
Quete tmp = new Quete();
tmp.setPrix(prix);
tmp.setMonnaie(monnaie);
tmp.setType(type);
tmp.setNom(bmeta.getTitle());
tmp.setDemandeur(bmeta.getAuthor());
tmp.setStatus(false);
tmp.setPrestataire("null");
QUETES[k] = tmp;
k++;
p.sendMessage("OK");
}else{
p.sendMessage("KO");
}
}else{
p.sendMessage("KO");
}
}
}```