How can I get GameMode by gamemode id?

GameMode gamemode = GameModes.byId(“CREATIVE”);

sponge 8.0

Please help me ?

RegistryTypes.GAME_MODE.get().findValue(ResourceKey.minecraft("creative"));

The issue is forge mods can add more game modes

1 Like

Thank you so much!