File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
src/main/java/org/spongepowered/api
entity/living/player/server Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2181,6 +2181,11 @@ public final class Keys {
21812181 */
21822182 public static final Key <Value <Integer >> POWER = Keys .key (ResourceKey .sponge ("power" ), Integer .class );
21832183
2184+ /**
2185+ * The previous {@link GameMode} of a {@link Humanoid}.
2186+ */
2187+ public static final Key <Value <GameMode >> PREVIOUS_GAME_MODE = Keys .key (ResourceKey .sponge ("previous_game_mode" ), GameMode .class );
2188+
21842189 /**
21852190 * A {@link Beacon}'s primary effect.
21862191 */
Original file line number Diff line number Diff line change @@ -344,6 +344,15 @@ default Value.Mutable<GameMode> gameMode() {
344344 return this .requireValue (Keys .GAME_MODE ).asMutable ();
345345 }
346346
347+ /**
348+ * {@link Keys#PREVIOUS_GAME_MODE}
349+ *
350+ * @return The previous game mode of the player
351+ */
352+ default Value .Mutable <GameMode > previousGameMode () {
353+ return this .requireValue (Keys .PREVIOUS_GAME_MODE ).asMutable ();
354+ }
355+
347356 /**
348357 * {@link Keys#STATISTICS}
349358 *
You can’t perform that action at this time.
0 commit comments