Search in sources :

Example 1 with AreaEffectCloud

use of net.minecraft.world.entity.AreaEffectCloud in project Tropicraft by Tropicraft.

the class TropiCreeperEntity method spawnLingeringCloud.

private void spawnLingeringCloud() {
    Collection<MobEffectInstance> collection = this.getActiveEffects();
    if (!collection.isEmpty()) {
        AreaEffectCloud areaeffectcloudentity = new AreaEffectCloud(level, getX(), getY(), getZ());
        areaeffectcloudentity.setRadius(2.5F);
        areaeffectcloudentity.setRadiusOnUse(-0.5F);
        areaeffectcloudentity.setWaitTime(10);
        areaeffectcloudentity.setDuration(areaeffectcloudentity.getDuration() / 2);
        areaeffectcloudentity.setRadiusPerTick(-areaeffectcloudentity.getRadius() / (float) areaeffectcloudentity.getDuration());
        for (MobEffectInstance effectinstance : collection) {
            areaeffectcloudentity.addEffect(new MobEffectInstance(effectinstance));
        }
        this.level.addFreshEntity(areaeffectcloudentity);
    }
}
Also used : MobEffectInstance(net.minecraft.world.effect.MobEffectInstance) AreaEffectCloud(net.minecraft.world.entity.AreaEffectCloud)

Aggregations

MobEffectInstance (net.minecraft.world.effect.MobEffectInstance)1 AreaEffectCloud (net.minecraft.world.entity.AreaEffectCloud)1