From c9b4ddb9237330be28542b90c6ec94f20dc2a1a6 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 18 Apr 2021 20:22:18 +0200 Subject: [PATCH] Add command damage type (This is Non-MC) --- mods/CORE/mcl_damage/init.lua | 1 + mods/MISC/mcl_commands/kill.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/CORE/mcl_damage/init.lua b/mods/CORE/mcl_damage/init.lua index 7f8469c3e..bc5280841 100644 --- a/mods/CORE/mcl_damage/init.lua +++ b/mods/CORE/mcl_damage/init.lua @@ -27,6 +27,7 @@ mcl_damage = { explosion = {is_explosion = true}, cramming = {bypasses_armor = true}, -- unused fireworks = {is_explosion = true}, -- unused + command = {bypasses_armor = true, bypasses_invulnerability = true, bypasses_magic = true}, } } diff --git a/mods/MISC/mcl_commands/kill.lua b/mods/MISC/mcl_commands/kill.lua index 2de69e6a0..3eac565d6 100644 --- a/mods/MISC/mcl_commands/kill.lua +++ b/mods/MISC/mcl_commands/kill.lua @@ -31,7 +31,7 @@ local function handle_kill_command(suspect, victim) mcl_death_messages.player_damage(victimref, msg) end -- DIE! - victimref:set_hp(0) + victimref:set_hp(0, {_mcl_type = "command"}) -- Log if not suspect == victim then minetest.log("action", string.format("%s killed %s using /kill", suspect, victim)) @@ -56,4 +56,4 @@ minetest.register_chatcommand("kill", { return handle_kill_command(name, param) end end, -}) \ No newline at end of file +})