Put on the armor ability to fly, unload armor lose the ability to fly

Started by muggles on

Topic category: Help with MCreator software

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Put on the armor ability to fly, unload armor lose the ability to fly

Put on armor for flying abilities but to unload the armor is still can continue to fly

        if (((entity instanceof LivingEntity) ? ((LivingEntity) entity).getItemStackFromSlot(EquipmentSlotType.CHEST) : ItemStack.EMPTY)

.getItem() == ChuangShiItem.body) {
if (entity instanceof PlayerEntity) {
((PlayerEntity) entity).abilities.allowFlying = (true);
((PlayerEntity) entity).sendPlayerAbilities();
}
} else if (((entity instanceof LivingEntity) ? ((LivingEntity) entity).getItemStackFromSlot(EquipmentSlotType.CHEST) : ItemStack.EMPTY)
.getItem() == ChuangShiItem.body) {
if (entity instanceof PlayerEntity) {
((PlayerEntity) entity).abilities.allowFlying = (false);
((PlayerEntity) entity).sendPlayerAbilities();
}
}
}