Uploaded image for project: 'Minecraft Realms'
  1. Minecraft Realms
  2. REALMS-10030

Changes using /gamerule do not persist when a world is unloaded/reloaded

    • Icon: Bug Bug
    • Resolution: Fixed
    • None
    • 1.18 (Bedrock), (16)
      1.19.11 Hotfix (Bedrock), 1.19.20 (Bedrock), 1.19.21 (Bedrock), 1.19.31 (Bedrock), 1.19.83 (Bedrock), 1.20.0 (Bedrock), 1.20.15 (Bedrock), 1.20.41 (Bedrock), 1.20.50 (Bedrock), 1.20.51 (Bedrock), 1.20.72 (Bedrock), 1.21.20 (Bedrock), 1.21.2 (Bedrock), 1.21.3 (Bedrock), 1.21.31 (Bedrock), 1.21.50 (Bedrock)
    • None
    • Confirmed
    • Bedrock
    • 741018, 975612

      Steps to Reproduce
      For the purposes of these steps we will be using the 'doinsomnia' game rule as an example.  You can use any game rule that is NOT in the world settings UI for this test.
      1.  Enter a Realm with an existing world.  Do not allow anyone else to connect to the Realm while testing.
      2.  As an owner, type in /gamerule doinsomnia
      3.  Take note of the value that is returned (value is true by default)
      4.  As an owner enter the following command:  /gamerule doinsomnia false
      5.  Leave the world and don't allow anyone else to connect to it during the test.
      6.  Wait 20 minutes for the Realm to be unloaded automatically by the server.  OR close and re-open the Realm in the Realm subscription page.
      7.  Re-join the world after the world has been automatically unloaded by the Realms server.
      8.  Type in /gamerule doinsomnia and take note of the output.

      Observed Results
      While the world is active an owner will change the doinsomnia rule to false to prevent phantoms from spawning.  During the session the rule will be in force until the world is unloaded either by everyone leaving and the server automatically unloading the world, or closing and re-opening the Realm through the subscriptions page. 
      If the owner re-enters the world, said owner will find the doinsomnia rule has been reset to the default state of true.   The owner will also discover any other rule set using /gamerule has been reset to default.

      Expected Results
      Realm owner expects to see /gamerule changes to persist through sessions / reloads as they did prior to 1.18.10.   For example, setting doinsomnia to false should remain false until someone such as the owner or an op were to change said setting.
      Note: This problem only affects game rules changed with the /gamerule command.   All players MUST be disconnected from the realm long enough for the world to be unloaded automatically by the server.

      I have also attached a video demonstrating this (I cut out the 20 minutes of doing nothing waiting for the server to unload).   So you must wait 20 minutes before re-joining the Realm.

          [REALMS-10030] Changes using /gamerule do not persist when a world is unloaded/reloaded

          Pinned comments

          [Mojang] DLon King added a comment - - edited

          We released a service-side fix for this on January 8th, 2025. Note that you may need to reset any settings that were cleared prior to that though. 

           

          Also note that there is a UI bug still in our Realms Edit world screen where updating any setting can result in some gamerules being reset to the default. Our client team is working on a fix for this, but in the meantime any gamerule updates made via in game slash commands will in fact persist. 

          [Mojang] DLon King added a comment - - edited We released a service-side fix for this on January 8th, 2025. Note that you may need to reset any settings that were cleared prior to that though.    Also note that there is a UI bug still in our Realms Edit world screen where updating any setting can result in some gamerules being reset to the default. Our client team is working on a fix for this, but in the meantime any gamerule updates made via in game slash commands will in fact persist. 

          All comments

          I can't promise when it will be fixed, but I can confirm that we have an engineer working on it currently. 

          [Mojang] DLon King added a comment - I can't promise when it will be fixed, but I can confirm that we have an engineer working on it currently. 

          Hi there @DLon King.

          Hope that you are well thanks for the update on this.

          Is there any timescale or timeline that you can give as to when the remaining issues for this realm ui bug will be fixed on realms

          Greatly appreciate the hard work

          Kind regards

          Rebelstrike2721 added a comment - Hi there @DLon King. Hope that you are well thanks for the update on this. Is there any timescale or timeline that you can give as to when the remaining issues for this realm ui bug will be fixed on realms Greatly appreciate the hard work Kind regards

          Jorgeson, we confirmed that the remaining issues with gamerules is due to the UI bug mentioned below. It appears that updating any settings via the Realms Edit World menu can result in gamerules reverting to their default. Our client team will be working on a fix for this, but in the meantime, any gamerule updates made via slash commands are in fact persisting across sessions. 

          [Mojang] DLon King added a comment - Jorgeson, we confirmed that the remaining issues with gamerules is due to the UI bug mentioned below. It appears that updating any settings via the Realms Edit World menu can result in gamerules reverting to their default. Our client team will be working on a fix for this, but in the meantime, any gamerule updates made via slash commands are in fact persisting across sessions. 

          gamerules in realms problem is still there.

          Jorgeson D. Indoy added a comment - gamerules in realms problem is still there.

          [Mojang] DLon King added a comment - - edited

          We released a service-side fix for this on January 8th, 2025. Note that you may need to reset any settings that were cleared prior to that though. 

           

          Also note that there is a UI bug still in our Realms Edit world screen where updating any setting can result in some gamerules being reset to the default. Our client team is working on a fix for this, but in the meantime any gamerule updates made via in game slash commands will in fact persist. 

          [Mojang] DLon King added a comment - - edited We released a service-side fix for this on January 8th, 2025. Note that you may need to reset any settings that were cleared prior to that though.    Also note that there is a UI bug still in our Realms Edit world screen where updating any setting can result in some gamerules being reset to the default. Our client team is working on a fix for this, but in the meantime any gamerule updates made via in game slash commands will in fact persist. 

          crazycoolcam added a comment - - edited

          @Gyver5681 Is this something you could share? It sounds like something I'd love to use on my realm if possible.

          crazycoolcam added a comment - - edited @Gyver5681 Is this something you could share? It sounds like something I'd love to use on my realm if possible.

          If you have a workaround addon can you share it with us?

          Connor Baney-Giampoala added a comment - If you have a workaround addon can you share it with us?

          Gyver5681 added a comment -

          Not sure if it's helpful or not, but in the process of writing an addon to work around this issue, I added a handler to catch the gamerule changed afterevent and save the change to my world data and found that when the realm was unloaded and reloaded, my saved world data was set to the original default. That tells me that the realm is actually using the /gamerule command during startup to set the game rules. So, I rewrote the add-on to add a separate UI that I manually manage instead of handling the gamerule event and it's worked great since.

          Gyver5681 added a comment - Not sure if it's helpful or not, but in the process of writing an addon to work around this issue, I added a handler to catch the gamerule changed afterevent and save the change to my world data and found that when the realm was unloaded and reloaded, my saved world data was set to the original default. That tells me that the realm is actually using the /gamerule command during startup to set the game rules. So, I rewrote the add-on to add a separate UI that I manually manage instead of handling the gamerule event and it's worked great since.

          Still affects 1.21.50. Affected 1.21.44 as well.

          xX_d3stroy3r_Xx added a comment - Still affects 1.21.50. Affected 1.21.44 as well.

          seems to be fixed in 1.21.41 again

          Rebelstrike2721 added a comment - seems to be fixed in 1.21.41 again

            Unassigned Unassigned
            Moonchips Moonchips
            Votes:
            103 Vote for this issue
            Watchers:
            79 Start watching this issue

              Created:
              Updated:
              Resolved: