Break Block to spawn entity spawns 2

Started by NicoFilippo on Mon, 12/07/2015 - 14:22
Last seen on 13:53, 25. Nov 2016
Joined Feb 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Break Block to spawn entity spawns 2
Mon, 12/07/2015 - 14:22

Name is terrible:

I am trying to make a mod. Adds a new block, and when broke, it is supposed to spawn a mob. But is spawns two. One is normal, as supposed to be, but the secon can be removed only by reloging!

Please help ::

Last seen on 22:34, 22. Nov 2017
Joined Oct 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Sorry, you can't do nothing
Mon, 12/07/2015 - 15:20

Sorry, you can't do nothing :c

You can make a event: Execute command, with the command /summon Entity X Y Z , but the player must have the cheats on

Last seen on 22:40, 19. Aug 2018
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
Part of your code looks like
Mon, 12/07/2015 - 17:00

Part of your code looks like this:

if(true){

sentity = Get.......
world.spawnEntityInWorld(sentity);

}

Simply add this under the if(true){ 

if (!world.isRemote){

So your code will look :

 

if(true){

if (!world.isRemote){

sentity = Get.......
world.spawnEntityInWorld(sentity);

}

}