001package net.minecraftforge.event.entity.living;
002
003import net.minecraft.entity.EntityLiving;
004import net.minecraft.world.World;
005import net.minecraftforge.event.Cancelable;
006import net.minecraftforge.event.Event.HasResult;
007
008public class LivingSpawnEvent extends LivingEvent
009{
010    public final World world;
011    public final float x;
012    public final float y;
013    public final float z;
014    
015    public LivingSpawnEvent(EntityLiving entity, World world, float x, float y, float z)
016    {
017        super(entity);
018        this.world = world;
019        this.x = x;
020        this.y = y;
021        this.z = z;
022    }
023
024    /**
025     * Fires before mob spawn events.
026     * 
027     * Result is significant:
028     *    DEFAULT: use vanilla spawn rules
029     *    ALLOW:   allow the spawn
030     *    DENY:    deny the spawn
031     *
032     */
033    @HasResult
034    public static class CheckSpawn extends LivingSpawnEvent
035    {
036        public CheckSpawn(EntityLiving entity, World world, float x, float y, float z)
037        {
038            super(entity, world, x, y, z);
039        }
040    }
041
042    @Cancelable
043    public static class SpecialSpawn extends LivingSpawnEvent
044    {
045        public SpecialSpawn(EntityLiving entity, World world, float x, float y, float z)
046        {
047            super(entity, world, x, y, z);
048        }
049    }
050}