Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6535

PlayerGameModeChangeEvent event incorrectly reports old gamemode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • MacOS 11.4
      Apple M1 chip
      Java 16

    • CraftBukkit version 3124-Spigot-66f9d3c-384e116 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT)
    • Yes

      PlayerGameModeChangeEvent event incorrectly reports the player's old gamemode.
      Using:

      public void onGameModeChange(PlayerGameModeChangeEvent event) {
              Player p = event.getPlayer();
              GameMode oldGM = p.getGameMode();
              GameMode newGM = event.getNewGameMode();
              Bukkit.getLogger().log(Level.INFO, "OLD: " + oldGM + ", NEW: " + newGM);
      }
      

      The output on 1.17 when switching from survival to creative is:

      OLD: CREATIVE, NEW: CREATIVE
      

      The output on 1.16.5 when switching from survival to creative is:

      OLD: SURVIVAL, NEW: CREATIVE
      

            2008Choco Parker Hawke
            eccentric Eccentric Devotion
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: