diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index f9a0af35b7..cec64f29a3 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1001,6 +1001,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return GameMode.getByValue(getHandle().gameMode.getGameModeForPlayer().getId()); } + @Override + public GameMode getPreviousGameMode() { + EnumGamemode previousGameMode = getHandle().gameMode.getPreviousGameModeForPlayer(); + + return (previousGameMode == null) ? null : GameMode.getByValue(previousGameMode.getId()); + } + @Override public void giveExp(int exp) { getHandle().giveExperiencePoints(exp);