fix mcl_bossbars using old entity "properties"

This commit is contained in:
cora 2023-09-28 23:38:03 +02:00 committed by ryvnf
parent 0273ace2c2
commit 6e8757893e

View File

@ -77,10 +77,12 @@ function mcl_bossbars.update_bar(id, def, priority)
end
function mcl_bossbars.update_boss(object, name, color)
local props = object:get_luaentity()
if not props or not props.is_mob then
props = object:get_properties()
local ent = object:get_luaentity()
local props = object:get_properties()
if not ent or not ent.is_mob then
props.health = object:get_hp()
else
props.health = ent.health
end
local bardef = {