A chance to spawn mob when a specific block is broken

Started by CristianLN on

Topic category: Help with modding (Java Edition)

Last seen on 11:28, 11. Jul 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A chance to spawn mob when a specific block is broken

I want to make a block (ex: diamond block) when broken to have a random chance to summon a mob (ex: creeper).

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
//This procedure has a 50%…
Fri, 06/19/2020 - 11:21

//This procedure has a 50% chance to spawn a creeper when breaking a diamond block

global trigger(on block broken){

   if(convert block to item(get block at x y z) == diamond_block){

      if(random between 0 and and 1 > 0.5){

         spawn mob at x y z type creeper                  

      }

   }

}

Last seen on 11:28, 11. Jul 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks
Fri, 06/19/2020 - 11:38

Thanks

Last seen on 13:05, 27. Mar 2024
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm trying to do the same…
Sun, 11/15/2020 - 07:04

I'm trying to do the same but two of the same mob will come out of the block 100% of the time, but I can't find a procedure that lets me spawn entities.