
net.minecraft.server.EntityCaveSpider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package net.minecraft.server;
import org.bukkit.entity.CaveSpider;
import org.jetbrains.annotations.NotNull;
public class EntityCaveSpider extends EntitySpider {
public EntityCaveSpider(World world) {
super(world);
this.setSize(0.7F, 0.5F);
}
protected void initAttributes() {
super.initAttributes();
this.getAttributeInstance(GenericAttributes.maxHealth).setValue(12.0D);
}
public boolean r(Entity entity) {
if (super.r(entity)) {
if (entity instanceof EntityLiving) {
byte b0 = 0;
if (this.world.getDifficulty() == EnumDifficulty.NORMAL) {
b0 = 7;
} else if (this.world.getDifficulty() == EnumDifficulty.HARD) {
b0 = 15;
}
if (b0 > 0) {
((EntityLiving) entity).addEffect(new MobEffect(MobEffectList.POISON.id, b0 * 20, 0));
}
}
return true;
} else {
return false;
}
}
public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, GroupDataEntity groupdataentity) {
return groupdataentity;
}
public float getHeadHeight() {
return 0.45F;
}
@NotNull
@Override
public CaveSpider getEntity() {
return (CaveSpider) super.getEntity();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy