package net.minecraft.world.entity.monster;

import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.Pose;
import net.minecraft.nbt.CompoundTag;
import javax.annotation.Nullable;
import net.minecraft.world.entity.SpawnGroupData;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.Difficulty;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import net.minecraft.world.entity.EntityType;

public class CaveSpider extends Spider {
    public CaveSpider(final EntityType<? extends CaveSpider> aku, final Level bjw) {
        super(aku, bjw);
    }
    
    @Override
    protected void registerAttributes() {
        super.registerAttributes();
        this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(12.0);
    }
    
    @Override
    public boolean doHurtTarget(final Entity akq) {
        if (super.doHurtTarget(akq)) {
            if (akq instanceof LivingEntity) {
                int integer3 = 0;
                if (this.level.getDifficulty() == Difficulty.NORMAL) {
                    integer3 = 7;
                }
                else if (this.level.getDifficulty() == Difficulty.HARD) {
                    integer3 = 15;
                }
                if (integer3 > 0) {
                    ((LivingEntity)akq).addEffect(new MobEffectInstance(MobEffects.POISON, integer3 * 20, 0));
                }
            }
            return true;
        }
        return false;
    }
    
    @Nullable
    @Override
    public SpawnGroupData finalizeSpawn(final LevelAccessor bjx, final DifficultyInstance ajj, final MobSpawnType alc, @Nullable final SpawnGroupData alm, @Nullable final CompoundTag jt) {
        return alm;
    }
    
    @Override
    protected float getStandingEyeHeight(final Pose alj, final EntityDimensions akr) {
        return 0.45f;
    }
}
