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

Add Player#getPreviousGameMode()

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • 1.18.1
    • Yes

      You can say that there are PlayerGameModeChangeEvent... Yes, but if player joined just now, I can't get their previous game mode, but the server knows it and the game/client too (in F3+F4). I would like if method to get it would be exposed to API.

      For what I'm need it: In join event, we put player in "waiting" room and changing their game mode to adventure, then after some time player will be teleported back to the world and their game mode will be restored. The problem is just inconvenience: if player press F3+F4 once, their game mode will be changed to adventure — not "real" game mode that they was used before quit. With getting previous mode method, we can set it first and then restore player game mode, so this problem will be solved.

      Thanks!

            Doc Doc
            molor Zhenya Zima
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: