Elytra stops early when hit with Smack

This commit is contained in:
patience 2026-02-22 20:39:51 +00:00
parent a404e3ada8
commit 668d4eae08
No known key found for this signature in database

View file

@ -23,6 +23,7 @@ public record SmackEffect(LevelBasedValue amount) implements EnchantmentEntityEf
public void apply(ServerLevel world, int level, EnchantedItemInUse context, Entity target, Vec3 pos) { public void apply(ServerLevel world, int level, EnchantedItemInUse context, Entity target, Vec3 pos) {
if (target instanceof Player player && player.getInventory().getArmor(2).is(Items.ELYTRA)) { if (target instanceof Player player && player.getInventory().getArmor(2).is(Items.ELYTRA)) {
player.getCooldowns().addCooldown(Items.ELYTRA, (int)(20 * this.amount.calculate(level)) ); // Tick conversion player.getCooldowns().addCooldown(Items.ELYTRA, (int)(20 * this.amount.calculate(level)) ); // Tick conversion
if(player.isFallFlying()){player.stopFallFlying();}
} }
} }