[SPIGOT-5727] GameRule doImmediateRespawn cannot be set per-world Created: 07/May/20  Updated: 09/May/20  Resolved: 09/May/20

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Kermina Awad Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: API, GameRules, api, gamerule
Environment:

Windows 10 1909
Java JDK 1.8.0_241


Attachments: File GameRuleBug-1.0.0.jar    
Version: CraftBukkit version git-Spigot-2040c4c-933e909 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   
  1. This bug does not affect Vanilla.
  2. The bug was tested on both CraftBukkit and Spigot.
  3. I did not find any reports about this bug.
  4. Only 1.15.2 was tested, as the gamerule in question is not present in older versions of the game. The bug occurs on both CraftBukkit and Spigot.
  5. Steps to reproduce:
    1. Run a fresh server with the reproduction plugin linked below.
    2. Enter the server.
    3. Use the command /step1
      1. This will set the gamerule to true on "world".
    4. Use the command /step2
      1. This will kill you.
      2. You should respawn immediately.
    5. Use the command /step3
      1. This will teleport you to the spawn of "world_nether".
    6. Use the command /step4
      1. Expected Behaviour: You should see the respawn screen.
      2. Actual Behaviour: You respawn immediately.
  6. Not a behavioural bug.
  7. Reproducer Plugin included below.

Time Spent: Approximately one hour.

I'm unsure if this affects other gamerules. This issue was reported to the Multiverse team, and I was able to reproduce it with both Multiverse and Hyperverse. So I believe it is a Bukkit bug.

Please see this comment and the one that follows it for related behaviour.

 

Reproduction Plugin Source: https://github.com/nicegamer7/GameRuleBug



 Comments   
Comment by Kermina Awad [ 08/May/20 ]

Awesome! Thanks for the speedy fix. Unfortunately I don't have access to view PRs, so could you let me know if and when it gets merged?

Comment by Shane Bee [ 08/May/20 ]

No problem. Im working on a PR right now. It was a really easy fix, just doing some testing before posting said PR

PR Submitted, if you have access to viewing PRs you can see it here:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/666/overview

Comment by Kermina Awad [ 08/May/20 ]

Yeah, by "does not affect Vanilla", I meant that it's expected that this gamerule would be global. Sorry, I should've been more clear.

Thanks for taking the time to look into this issue.

Comment by Shane Bee [ 08/May/20 ]

 This bug does not affect Vanilla

This actually works quite different in vanilla. In vanilla, the game rule is not per world. Testing on a single player game, if I change the game rule, its the same in all worlds.

 Looking at how this works, as well as looking at Minecraft's code, it appears the game rule is handled by the client. When setting the game rule via command, a packet is sent to all clients telling them the game rule has changed. I would assume the same happens when you log into the server.
I think the issue here is that because vanilla is not per world, changing worlds does not re-send this packet to the client.

My assumption to fix this would be sending this packet to the client when the player changes worlds.

Generated at Sat Apr 05 09:38:14 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.