Elytra stops early when hit with Smack
This commit is contained in:
parent
a404e3ada8
commit
668d4eae08
|
|
@ -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();}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue