From 3c6d79ecb3c7303e95a33b60804dc065268df7e5 Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 11 Nov 2022 20:18:16 +0100 Subject: [PATCH] Add entity name to debug box --- mods/ENTITIES/mcl_mobs/api.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index dd75b8e3d3..083b648e48 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -58,7 +58,11 @@ end function mob_class:update_tag() --update nametag and/or the debug box local tag if mobs_debug then - tag = "nametag = '"..tostring(self.nametag).."'\n".. + local name = self.name + if self.nametag and self.nametag ~= "" then + name = self.nametag + end + tag = "name = '"..tostring(name).."'\n".. "state = '"..tostring(self.state).."'\n".. "order = '"..tostring(self.order).."'\n".. "attack = "..tostring(self.attack).."\n"..