package net.minecraft.world.entity.monster;

import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.projectile.Arrow;
import net.minecraft.world.entity.projectile.AbstractArrow;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundEvent;
import java.util.Random;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.Level;
import net.minecraft.world.entity.EntityType;

public class Stray extends AbstractSkeleton {
    public Stray(final EntityType<? extends Stray> aoq, final Level bqb) {
        super(aoq, bqb);
    }
    
    public static boolean checkStraySpawnRules(final EntityType<Stray> aoq, final LevelAccessor bqc, final MobSpawnType apb, final BlockPos fu, final Random random) {
        return Monster.checkMonsterSpawnRules(aoq, bqc, apb, fu, random) && (apb == MobSpawnType.SPAWNER || bqc.canSeeSky(fu));
    }
    
    @Override
    protected SoundEvent getAmbientSound() {
        return SoundEvents.STRAY_AMBIENT;
    }
    
    @Override
    protected SoundEvent getHurtSound(final DamageSource anw) {
        return SoundEvents.STRAY_HURT;
    }
    
    @Override
    protected SoundEvent getDeathSound() {
        return SoundEvents.STRAY_DEATH;
    }
    
    @Override
    SoundEvent getStepSound() {
        return SoundEvents.STRAY_STEP;
    }
    
    @Override
    protected AbstractArrow getArrow(final ItemStack bki, final float float2) {
        final AbstractArrow beg4 = super.getArrow(bki, float2);
        if (beg4 instanceof Arrow) {
            ((Arrow)beg4).addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 600));
        }
        return beg4;
    }
}
