So basically, I want this plugin to not drop any unenchanted armor on a players death. It works well unless the armor piece are damaged. Un-damaged armor pieces won't drop. Which is supposed to be like that. Damaged armor drops however. Which was not my intention at all. If someone could fix my code up that'd be awesome!
My code:
My code:
Code:
@EventHandler[/COLOR][/FONT]
[FONT=Droid Sans][COLOR=rgb(44, 44, 44)] public void onPlayerDeath(PlayerDeathEvent e)
{
for (ItemStack item : e.getDrops())
{
Material mat = item.getType();
if (((mat == Material.DIAMOND_HELMET) || (mat == Material.DIAMOND_CHESTPLATE) || (mat == Material.DIAMOND_LEGGINGS) || (mat == Material.DIAMOND_BOOTS) || (mat == Material.DIAMOND_SWORD)) &&
(item.getEnchantments().isEmpty())) {
item.setType(Material.AIR);
