Posted February 7, 201510 yr Hello, i would like to spawn many entitys on break block, but could only do spawn one: My onBlockDestroyedByPlayer: public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { if (!par1World.isRemote) { EntityCupim entitycupim = new EntityCupim(par1World); entitycupim.setLocationAndAngles((double)par2 + 0.5D, (double)par3, (double)par4 + 0.5D, 0.0F, 0.0F); par1World.spawnEntityInWorld(entitycupim); entitycupim.spawnExplosionParticle(); } super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5); } http://i.imgur.com/ZT2C1L9.png[/img]
February 7, 201510 yr Basic Java, if you don't know it then you shouldn't be here. for (int i = 0; i < 32; i++) { // Spawn entity } Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
February 7, 201510 yr Author Basic Java, if you don't know it then you shouldn't be here. for (int i = 0; i < 32; i++) { // Spawn entity } Good friend, I would first like to thank you. I believe should treat me better, I have head full of problems and simply forgot this detail, then came to the support, to ask a simple question... Well, leveraging the same topic, could help me make my block spawn randomly my termites, if not is much ... http://i.imgur.com/ZT2C1L9.png[/img]
February 7, 201510 yr Replace 32 with (new Random()).nextInt(maxEntities) Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
February 7, 201510 yr Author What do you mean by random? A random number? wanted him that spawn randomly in the world, but I've finished this part ... Final Result: http://i.imgur.com/ZT2C1L9.png[/img]
February 7, 201510 yr Author Replace 32 with (new Random()).nextInt(maxEntities) thank you, I left as 32 even, it is more than the enough http://i.imgur.com/ZT2C1L9.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.