diff --git a/mods/playertag/init.lua b/mods/playertag/init.lua index 033d35f..e684dfa 100644 --- a/mods/playertag/init.lua +++ b/mods/playertag/init.lua @@ -57,9 +57,6 @@ local nametag = { function nametag:on_step(dtime) local wielder = self.wielder - wielder:set_nametag_attributes({ - color = {a = 0, r = 0, g = 0, b = 0} - }) if wielder == nil then self.object:remove() elseif minetest.get_player_by_name(wielder:get_player_name()) == nil then @@ -85,6 +82,14 @@ local function step() end minetest.after(10, step) +minetest.register_globalstep(function(player) + for _, player in pairs(minetest.get_connected_players()) do + player:set_nametag_attributes({ + color = {a = 0, r = 0, g = 0, b = 0} + }) + end +end) + minetest.register_on_joinplayer(function(player) if not player.tag then player:set_nametag_attributes({