Java Code Examples for net.minecraft.entity.projectile.EntityEgg

The following examples show how to use net.minecraft.entity.projectile.EntityEgg . These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.

Example 1

Source Project: CommunityMod Source File: EntityExplodingChicken.java License: GNU Lesser General Public License v2.1 6 votes /** * 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

Example 3

Example 4

Example 5

Example 6

Example 7