MikeDark Posted February 7, 2015 Share Posted February 7, 2015 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); } Quote http://i.imgur.com/ZT2C1L9.png[/img] Link to comment Share on other sites More sharing options...
MikeDark Posted February 7, 2015 Author Share Posted February 7, 2015 Well... just spawn more?! Yes Quote http://i.imgur.com/ZT2C1L9.png[/img] Link to comment Share on other sites More sharing options...
shadowfacts Posted February 7, 2015 Share Posted February 7, 2015 Basic Java, if you don't know it then you shouldn't be here. for (int i = 0; i < 32; i++) { // Spawn entity } Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods Link to comment Share on other sites More sharing options...
MikeDark Posted February 7, 2015 Author Share Posted February 7, 2015 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 ... Quote http://i.imgur.com/ZT2C1L9.png[/img] Link to comment Share on other sites More sharing options...
Anon10W1z Posted February 7, 2015 Share Posted February 7, 2015 What do you mean by random? A random number? Quote Maker of the Craft++ mod. Link to comment Share on other sites More sharing options...
shadowfacts Posted February 7, 2015 Share Posted February 7, 2015 Replace 32 with (new Random()).nextInt(maxEntities) Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods Link to comment Share on other sites More sharing options...
MikeDark Posted February 7, 2015 Author Share Posted February 7, 2015 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: Quote http://i.imgur.com/ZT2C1L9.png[/img] Link to comment Share on other sites More sharing options...
MikeDark Posted February 7, 2015 Author Share Posted February 7, 2015 Replace 32 with (new Random()).nextInt(maxEntities) thank you, I left as 32 even, it is more than the enough Quote http://i.imgur.com/ZT2C1L9.png[/img] Link to comment Share on other sites More sharing options...
Recommended Posts
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.