I have something that counts how many kills do you have, it adds you to an array onPlayerJoinEvent if you are not in there already. I have the kills in PureChat(nametag) PureChat sets your nameTag when you join right. So I get errors when PureChat sets the nametag faster than my kill counter that adds player to array on playerjoinevent.
You've posted a lot recently... I'd have thought you'd have got the message by now that you need to include detail when asking for help: where is the code, and what are the errors?
public static $kills = []; PHP: public function onJoin(PlayerJoinEvent $event) { $uuid = $event->getPlayer()->getUniqueId(); if (!in_array(strtolower($uuid), API::$kills)) { API::$kills[strtolower($uuid)] = 0; } }
https://pastebin.com/szexvXu3 API:line126 public static function getKills(Player $player) { $uuid = strtolower($player->getUniqueId()); return self::$kills[$uuid]; }
Why do you only post snippets, and not use code blocks (the little + on the toolbar)? I found some of the relevant code in your other post, but you'd make life easier for everyone if you just posted the full code on github. For starters, why is getKills() a static method? Static methods are stateless - that means if you call them with a given argument you must always get the same return value...