mirror of
https://github.com/moparisthebest/minetest
synced 2024-11-16 06:15:06 -05:00
Add "/mods" command to list mods to client
This commit is contained in:
parent
136eb32389
commit
c62a121cca
@ -371,3 +371,20 @@ minetest.register_chatcommand("set", {
|
|||||||
end,
|
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,
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user