From c62a121cca1df697604aaea0e7e6cf7ddcf8d08c Mon Sep 17 00:00:00 2001 From: Matthew I Date: Sat, 21 Jul 2012 21:41:27 -0400 Subject: [PATCH] Add "/mods" command to list mods to client --- builtin/chatcommands.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua index a60d3028..f9715d92 100644 --- a/builtin/chatcommands.lua +++ b/builtin/chatcommands.lua @@ -371,3 +371,20 @@ minetest.register_chatcommand("set", { end, }) +minetest.register_chatcommand("mods", { + params = "", + description = "lists mods installed on the server", + privs = {}, + func = function(name, param) + local response = "" + local modnames = minetest.get_modnames() + for i, mod in ipairs(modnames) do + response = response .. mod + -- Add space if not at the end + if i ~= #modnames then + response = response .. " " + end + end + minetest.chat_send_player(name, response) + end, +}) \ No newline at end of file -- 2.30.2