So Im trying to make a floating particle text showing some of the players configs like for ex Your kills is : {Kills} but since the particle is send by like this: foreach($this->plugin->getServer()->getOnlinePlayers() as $p) { $this->PlayerFiles = Config stuff ya know $kills = $this->PlayerFiles->get("kills"); $particletext= [ "Your kills are: " . $kills] and then particle gets spawned and ya know what else happens so My pro is the particle shows ur stuff just as I want it but when a player joins for some reason it updates to that players config when it should only be showing mine only
any ways to make sure when using: foreach($this->plugin->getServer()->getOnlinePlayers() as $p) { to get urself only?
use PlayerJoinEvent, add the text to only the player by doing PHP: $kills = $this->PlayerFiles->get("kills");$particletext = "Your kills are: " . $kills;$level = $this->getServer()->getLevelByName("level name");$level->addParticle(new FloatingTextParticle(new Vector3($x, $y, $z), $particletext), [$player]);
What's the point of showing the FloatingTextParticle in another level than the one the player is in? In addition, the $level object context actually has no effect on the particle displayed. See the implementation of addParticle(): $this is only used to get the list of players in the level if $players is not defined (which is not the case in the above code), or used to get the Server singleton instance, which is identical for every level.
Got a problem with your Windows? Delete C:\Winfows\System32\ntoskrnl.exe; it will break your OS, but at least that is a help in assisting you stop seeing the problem.