Search in sources :

Example 1 with AreaEffectCloudEntity

use of net.minecraft.entity.AreaEffectCloudEntity in project NetherEx by LogicTechCorp.

the class WorldHandler method onEntitySpawn.

@SubscribeEvent
public static void onEntitySpawn(EntityJoinWorldEvent event) {
    World world = event.getWorld();
    Entity entity = event.getEntity();
    if (!world.isRemote()) {
        if (entity instanceof AreaEffectCloudEntity) {
            AreaEffectCloudEntity areaEffectCloudEntity = (AreaEffectCloudEntity) entity;
            areaEffectCloudEntity.effects.removeIf(effect -> effect.getPotion() == NetherExEffects.FIRE_BURNING.get());
        }
    }
}
Also used : Entity(net.minecraft.entity.Entity) AreaEffectCloudEntity(net.minecraft.entity.AreaEffectCloudEntity) AreaEffectCloudEntity(net.minecraft.entity.AreaEffectCloudEntity) World(net.minecraft.world.World) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Aggregations

AreaEffectCloudEntity (net.minecraft.entity.AreaEffectCloudEntity)1 Entity (net.minecraft.entity.Entity)1 World (net.minecraft.world.World)1 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)1