aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-11-28 07:21:43 -0500
committerGitHub <noreply@github.com>2022-11-28 07:21:43 -0500
commitd0a118f5b1a2cada1d46d4acac55a998e268154d (patch)
tree72e38e81f8f9ef0d89a6deafa74daa6a261ad49e /doc/lua_api.txt
parent3fd5bff128cacb068c0758d0b33b425dc88beed7 (diff)
downloadminetest-d0a118f5b1a2cada1d46d4acac55a998e268154d.tar.xz
Add `minetest.get_game_info` and allow reading `game.conf` (#12989)
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 1c8cc1022..b58c75d11 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -4879,6 +4879,18 @@ Utilities
or checking if a mod is enabled.
* `minetest.get_modnames()`: returns a list of enabled mods, sorted alphabetically.
* Does not include disabled mods, even if they are installed.
+* `minetest.get_game_info()`: returns a table containing information about the
+ current game. Note that other meta information (e.g. version/release number)
+ can be manually read from `game.conf` in the game's root directory.
+
+ {
+ id = string,
+ title = string,
+ author = string,
+ -- The root directory of the game
+ path = string,
+ }
+
* `minetest.get_worldpath()`: returns e.g. `"/home/user/.minetest/world"`
* Useful for storing custom data
* `minetest.is_singleplayer()`