Полет при одевании брони 1.12.2

Версия Minecraft
1.12.2
3
0
Всем привет, я новичок поэтому простите если туплю.
Хочу сделать чтобы при одевании брони игроку давался полет и некоторые эффекты.

Java:
public class ArmorBase extends ItemArmor implements HasModel {



    public ArmorBase(String name, ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) {

        super(materialIn, renderIndexIn, equipmentSlotIn);

        setRegistryName(name);

        setUnlocalizedName(name);

        setCreativeTab(Main.ETRA_TAB);

        InitItems.ITEMS.add(this);

        setMaxDamage((int) Double.NEGATIVE_INFINITY);

    }





    @Override

    public void onArmorTick(final World world, final EntityPlayer player, final ItemStack itemStack) {

        player.capabilities.allowFlying = false;



        if (!(player.getEquipmentAndArmor().equals(null))) {

            player.capabilities.allowFlying = true;

            System.out.println("True flihgt");

            player.addPotionEffect(new PotionEffect(Potion.getPotionById(12), 40));

            player.addPotionEffect(new PotionEffect(Potion.getPotionById(1), 40));

            player.addPotionEffect(new PotionEffect(Potion.getPotionById(16), 100, 0));

            player.addPotionEffect(new PotionEffect(Potion.getPotionById(10), 2, 1));

        } else {

            System.out.println("False flight");

            player.fallDistance = 0.0F;

            player.capabilities.allowFlying = false;

        }

    

    }





    @Override

    public void registerModels() {

        Main.proxy.registerItemRender(this, 0, "inventory");

    }

}
 
Последнее редактирование:
681
20
319
Тут есть два варианта
Первое: в классе брони делаешь метод на проверку вся ли броня одета, если да, делаешь эвент и выдаешь все что тебе нужно.
Второе: Создаешь свое зельё полета и выдаешь его на одну секунду в ArmorTick
 
Сверху