Trying to make player turn into spectator mode when dead (SOLVED)

Started by aaronisda on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Trying to make player turn into spectator mode when dead (SOLVED)
Fri, 06/30/2023 - 22:18 (edited)

Hello, I've made a procedure that is supposed to set the player's spawn to where they died and then set them to spectator. But, when they turn into spectator, they don't spawn where they died, they spawn at the world spawn, or if right clicked a bed, they spawned at their bed. I've tried adding a 1 tick delay between setting the spawn and setting to spectator mode, but nothing works. I also made another procedure that sets the gamerule doImmediateRespawn to true whenever a world tick happens. I've sent the code as an image also.My code

Edited by aaronisda on Fri, 06/30/2023 - 22:18
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think you can replace the …
Thu, 06/29/2023 - 16:40

I think you can replace the "Set spawn" block with a "Cancel event that triggered global trigger" block (under Advanced). This way, the player doesn't die at all. You might need to set the player's health as full as well.

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you, I would've never…
Fri, 06/30/2023 - 22:18

Thank you, I would've never thought of that since I'm since familiarizing myself with MCreator's coding blocks.