util.input.list
Client
Retrieves the names of all currently registered console commands
Syntax
local commands = util.input.list()Names only — not the handlers themselves.
- Unordered — backed by a hash map, so iteration order won't match registration order.
- Read-only — safe to call anytime; has no effect on registered handlers.
- All environments — includes commands registered by every resource's script, not just the caller's own.
Parameters
| No parameters are accepted by this function |
|---|
Returns
| Type | Name | Description |
|---|---|---|
string[] | commands | Array of registered command name strings |
Examples
for i, name in ipairs(util.input.list()) do
core.engine.print("info", i, name)
endlocal function is_registered(name)
for _, cmd in ipairs(util.input.list()) do
if cmd == name then return true end
end
return false
end
if is_registered("teleport") then
core.engine.print("info", "teleport command is available")
end