summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorOgelGames <olliverdc28@gmail.com>2021-01-03 01:13:53 +1100
committerGitHub <noreply@github.com>2021-01-02 15:13:53 +0100
commitad58fb22064c7db223cb825596c12f93f2a75a26 (patch)
treee52a1b04779baa9dc4977be9d0a6f6f357cbe28c /doc/lua_api.txt
parent92aac69b36d37ace8d2e06721cfa5e488427dcdf (diff)
downloadminetest-ad58fb22064c7db223cb825596c12f93f2a75a26.tar.gz
minetest-ad58fb22064c7db223cb825596c12f93f2a75a26.tar.bz2
minetest-ad58fb22064c7db223cb825596c12f93f2a75a26.zip
Clarify documentation of minetest.get_modpath and minetest.get_modnames (#10771)
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 800fc0c24..8bf6ade69 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -4327,11 +4327,14 @@ Utilities
* `minetest.get_current_modname()`: returns the currently loading mod's name,
when loading a mod.
-* `minetest.get_modpath(modname)`: returns e.g.
- `"/home/user/.minetest/usermods/modname"`.
- * Useful for loading additional `.lua` modules or static data from mod
-* `minetest.get_modnames()`: returns a list of installed mods
- * Return a list of installed mods, sorted alphabetically
+* `minetest.get_modpath(modname)`: returns the directory path for a mod,
+ e.g. `"/home/user/.minetest/usermods/modname"`.
+ * Returns nil if the mod is not enabled or does not exist (not installed).
+ * Works regardless of whether the mod has been loaded yet.
+ * Useful for loading additional `.lua` modules or static data from a mod,
+ 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_worldpath()`: returns e.g. `"/home/user/.minetest/world"`
* Useful for storing custom data
* `minetest.is_singleplayer()`