package net.tslat.aoa3.content.item.weapon.maul; import net.minecraft.network.chat.Component; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import net.tslat.aoa3.library.constant.AttackSpeed; import net.tslat.aoa3.util.EntityUtil; import net.tslat.aoa3.util.LocaleUtil; import org.jetbrains.annotations.Nullable; import java.util.List; public class HorizonMaul extends BaseMaul { public HorizonMaul() { super(23.0f, AttackSpeed.THIRD, 7d, 1300); } @Override protected void doMeleeEffect(ItemStack stack, Entity target, LivingEntity attacker, float attackCooldown) { if (target instanceof LivingEntity && attackCooldown == 1f && !EntityUtil.isImmuneToSpecialAttacks(target, attacker)) ((LivingEntity)target).addEffect(new MobEffectInstance(MobEffects.LEVITATION, 35, 0, true, true)); } @Override public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List tooltip, TooltipFlag flagIn) { tooltip.add(LocaleUtil.getFormattedItemDescriptionText(this, LocaleUtil.ItemDescriptionType.BENEFICIAL, 1)); super.appendHoverText(stack, worldIn, tooltip, flagIn); } }