From 7d3641021b755be133dea58404fcb039211fbe52 Mon Sep 17 00:00:00 2001 From: Elijah Duffy Date: Sat, 3 Oct 2020 09:38:08 -0700 Subject: Lua API: Add register_on_chatcommand to SSM and CSM (#7862) Allows catching a chatcommand call just after the command and the parameters are parsed but before its existence is checked and before the corresponding function is run. Returning `true` from a callback function will prevent default handling of the command leaving mods to handle the command manually. --- builtin/game/register.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin/game/register.lua') diff --git a/builtin/game/register.lua b/builtin/game/register.lua index 1034d4f2b..3de67c04b 100644 --- a/builtin/game/register.lua +++ b/builtin/game/register.lua @@ -584,6 +584,7 @@ core.unregister_biome = make_wrap_deregistration(core.register_biome, core.clear_registered_biomes, core.registered_biomes) core.registered_on_chat_messages, core.register_on_chat_message = make_registration() +core.registered_on_chatcommands, core.register_on_chatcommand = make_registration() core.registered_globalsteps, core.register_globalstep = make_registration() core.registered_playerevents, core.register_playerevent = make_registration() core.registered_on_mods_loaded, core.register_on_mods_loaded = make_registration() -- cgit v1.2.3