diff --git a/mods/PLAYER/mcl_gamemode/init.lua b/mods/PLAYER/mcl_gamemode/init.lua index a43a9c1ff..2edc169f9 100644 --- a/mods/PLAYER/mcl_gamemode/init.lua +++ b/mods/PLAYER/mcl_gamemode/init.lua @@ -44,7 +44,15 @@ function mcl_gamemode.get_gamemode(player) if mt_is_creative_enabled(player:get_player_name()) then return "creative" end - return player:get_meta():get_string("gamemode") + + local gm = player:get_meta():get("gamemode") + if gm then + ---@diagnostic disable-next-line: return-type-mismatch + return gm + else + player:get_meta():set_string("gamemode", "survival") + return "survival" + end end function minetest.is_creative_enabled(name)