Hearts and Water Breathing Not Registering

Discussion in 'Spigot Plugin Help' started by bmac20, May 22, 2016.

  1. I have a semi-custom enchantment plugin on my server. It just allows enchantments to be placed on armor. But for some reason, when I equip a chestplate with the health enchantment, it does not give me extra hearts.
    Code (Text):
    public class Health extends CustomEnchantment {

        static final Material[] SPEED_ITEMS = new Material[] {
                Material.LEATHER_CHESTPLATE,
                Material.IRON_CHESTPLATE,
                Material.CHAINMAIL_CHESTPLATE,
                Material.GOLD_CHESTPLATE,
                Material.DIAMOND_CHESTPLATE
        };

        public Health() {
            super("Health", SPEED_ITEMS, 2);
            this.max = 2;
            this.isTableEnabled = false;
        }

        @Override
        public void applyEquipEffect(Player player, int enchantLevel) {
            player.setMaxHealth(26);

        }

        @Override
        public void applyUnequipEffect(Player player, int enchantLevel) {
            player.setMaxHealth(20);
        }
    }
     
    I am using EnchantmentAPI
     
  2. Bump. Please help.
     
  3. Unfortunately, at the moment EnchantmentAPI's applyEquipEffect and applyUnequipEffect doesn't work, and will hopefully be fixed in an upcoming version.