net.minecraft.entity.projectile.EntityEgg Java Examples

The following examples show how to use net.minecraft.entity.projectile.EntityEgg. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntityExplodingChicken.java    From CommunityMod with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Creates an explosion as determined by this creeper's power and explosion radius.
 */
private void explode()
{
    if (!this.world.isRemote)
    {
        this.playSound(SoundEvents.ENTITY_CHICKEN_DEATH, 2.0F, 1F);
        boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this);

    	for (int i=0; i<30; i++)
    	{
            EntityEgg entityegg = new EntityEgg(world, this);
            entityegg.motionY = this.world.rand.nextFloat() * .5F;
            entityegg.motionX = (this.world.rand.nextFloat() - 0.5F) * 1F;
            entityegg.motionZ = (this.world.rand.nextFloat() - 0.5F) * 1F;
            world.spawnEntity(entityegg);
    	}
    	this.dead = true;
        this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, flag);
        this.setDead();
    }
}
 
Example #2
Source File: GoldenEgg.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void onAltarAction(World world, BlockPos pos) {
	EntityEgg egg = new EntityEgg(world, pos.getX() + 0.5, pos.getY() + 1.25, pos.getZ() + 0.5);
	world.spawnEntity(egg);
	egg.addVelocity(world.rand.nextFloat() * 2 - 1, world.rand.nextFloat(), world.rand.nextFloat() * 2 - 1);
	egg.velocityChanged = true;
}
 
Example #3
Source File: CraftEgg.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftEgg(CraftServer server, EntityEgg entity) {
    super(server, entity);
}
 
Example #4
Source File: CraftEgg.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EntityEgg getHandle() {
    return (EntityEgg) entity;
}
 
Example #5
Source File: CraftEgg.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public CraftEgg(CraftServer server, EntityEgg entity) {
    super(server, entity);
}
 
Example #6
Source File: CraftEgg.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EntityEgg getHandle() {
    return (EntityEgg) entity;
}
 
Example #7
Source File: DispenserBehaviorEgg.java    From Artifacts with MIT License 4 votes vote down vote up
/**
 * Return the projectile entity spawned by this dispense behavior.
 */
protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition)
{
    return new EntityEgg(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ());
}