Hey, I'm trying to make a Pill plugin where when you click an item, it runs something, but I'm trying to make it so it only runs if there is a certain lore on an item. I want to test for multiple lines, not just one.
My code so far:
Everything is working perfectly, but it's just I want to add that feature but idk how.
My code so far:
Everything is working perfectly, but it's just I want to add that feature but idk how.
Code:
if (p.getItemInHand().getType() == Material.PUMPKIN_SEEDS) {
if (p.getItemInHand().getItemMeta().getDisplayName().contains("§b§lSpeed Pill")) {
if(p.getItemInHand().getItemMeta().getLore().equals("§b§lEffects:\n§fSpeed II\n\n§eRight click to swallow!"));
if (p.getItemInHand().getAmount() >= 2) {
p.sendMessage("§cYou can not take multiple pills at once! Seperate them!");
} else {
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 700, 1));
p.sendMessage("§bYou have taken a §fSpeed Pill §band gained §f§lSpeed II §bfor §f§l35 seconds");
p.setItemInHand(air);
p.playSound(p.getLocation(), Sound.FIZZ, 1, 1);
Bukkit.getWorld("world").playEffect(p.getLocation(), Effect.MOBSPAWNER_FLAMES, 20303);
p.playSound(p.getLocation(), Sound.EAT, 1, 1);
}
}
}
}
