How to make a random block spawn when a player dies a specific death

Started by RoboMan on

Topic category: Help with modding (Java Edition)

Last seen on 06:49, 13. Oct 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a random block spawn when a player dies a specific death

The title might sound a bit confusing, but I will try my best to explain it better. I have a custom block (I'll call Block 0 to avoid confusion) that kills you when you step on it. I have 13 other custom blocks (I'll call Blocks 1 - 13) that I want to have a random chance of spawning when an entity is killed by Block 0. For example, when an entity dies to Block 0, there is a 1/13 chance of Block 7 being spawned. I would also like Blocks 1 - 13 to only spawn once. How would I do this?

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
player dies if block at X Y …
Sun, 10/03/2021 - 21:40

player dies

if block at X Y - 1 Z = Block 0

do if random 0, 1 =< 0.13

do place at X Y Z 

else if random 0, 1 =< 0.13

etc etc etc

Last seen on 06:49, 13. Oct 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wouldn't using the global…
Sun, 10/03/2021 - 22:49

Wouldn't using the global trigger "Player dies" mean that regardless of how they die, it will spawn a block?

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
then why not put it next to…
Sun, 10/03/2021 - 23:26

then why not put it next to your procedure to kill the player on block triggers

Last seen on 20:30, 19. Mar 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
there is no longer a "player…
Sat, 03/19/2022 - 16:20

there is no longer a "player dies" trigger. Is there a replacement, or did I just miss it?

Last seen on 13:56, 19. Dec 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity is killed maybe?
Sat, 03/19/2022 - 21:31

Entity is killed maybe?

Last seen on 13:56, 19. Dec 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Then you can check if the…
Sat, 03/19/2022 - 21:31

Then you can check if the entity that died is a player.