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> aku, final Level bjw) {
        super(aku, bjw);
    }
    
    public static boolean checkStraySpawnRules(final EntityType<Stray> aku, final LevelAccessor bjx, final MobSpawnType alc, final BlockPos fk, final Random random) {
        return Monster.checkMonsterSpawnRules(aku, bjx, alc, fk, random) && (alc == MobSpawnType.SPAWNER || bjx.canSeeSky(fk));
    }
    
    @Override
    protected SoundEvent getAmbientSound() {
        return SoundEvents.STRAY_AMBIENT;
    }
    
    @Override
    protected SoundEvent getHurtSound(final DamageSource ajz) {
        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 ben, final float float2) {
        final AbstractArrow ayn4 = super.getArrow(ben, float2);
        if (ayn4 instanceof Arrow) {
            ((Arrow)ayn4).addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 600));
        }
        return ayn4;
    }
}
