Hello, I try to make invisible the FloatingTextParticles when a player changes his world but it does not work.... The Main : PHP: public $holos = array();public function TaskText($joueur){ $particle1 = new FloatingTextParticle(new Vector3(103, 13, 129), "message", "title"); $this->holos[$joueur->getName()] = $particle1; $this->getServer()->getDefaultLevel()->addParticle($particle1);}public function onPlayerPreLogin(PlayerPreLoginEvent $event){ $player = $event->getPlayer(); $this->getServer()->getScheduler()->scheduleRepeatingTask(new TaskText($this, $player), 200);}public function onLevelChange(EntityLevelChangeEvent $event){ $player = $event->getEntity(); $particle1 = $this->holos[$player->getName()]; if($player instanceof Player){ $world = $event->getTarget()->getName(); if(!$world == "world"){ $particle1->setInvisible(true); $this->getServer()->getDefaultLevel()->addParticle($particle1); }else{ $particle1->setInvisible(false); $this->getServer()->getDefaultLevel()->addParticle($particle1); } }} The Task : PHP: public function __construct(Main $owner, Player $player){ parent::__construct($owner); $this->owner = $owner; $this->player = $player; } public function onRun($currentTick){ $this->owner->TaskText($this->player); }
I do that but it does not change anything... Look : PHP: $particle1->setInvisible(true);$this->getServer()->getDefaultLevel()->addParticle($particle1);