Hey! I write a plugin, that spawns FloatingTextParticle with a command and remove them. PHP: public function onCommand(CommandSender $sender, Command $command, $label, array $args){ switch($command->getName()){ case "spawnparticle": $particle = new FloatingTextParticle(new Vector3(127.5, 7, 108.8), Color::WHITE."Teeeeeeeeeeeeeest\n Test!", $this->anfang.Color::YELLOW."T".Color::GOLD."est".$this->anfang); $this->getServer()->getDefaultLevel()->addParticle($particle); break; case "removeparticle": $particle->setInvisible(); break; }} But if I do /removeparticle, nothing happens! Does anyone know why? Thanks!
PHP: public function onCommand(CommandSender $sender, Command $command, $label, array $args){switch($command->getName()){case "spawnparticle":$this->particle = new FloatingTextParticle(new Vector3(127.5, 7, 108.8), Color::WHITE."Teeeeeeeeeeeeeest\n Test!", $this->anfang.Color::YELLOW."T".Color::GOLD."est".$this->anfang);$this->getServer()->getDefaultLevel()->addParticle($particle);break;case "removeparticle":$this->particle->setInvisible();break;}}
I also tried this: PHP: public function onCommand(CommandSender $sender, Command $command, $label, array $args){switch($command->getName()){ case "removeparticle":$particle = new FloatingTextParticle(new Vector3(127.5, 7, 108.8), Color::WHITE."Teeeeeeeeeeeeeest\n Test!", $this->anfang.Color::YELLOW."T".Color::GOLD."est".$this->anfang); $this->getServer()->getDefaultLevel()->addParticle($particle); $particle->setInvisible(); break;}}
use this : https://github.com/Samueljh1/Darkhammer-Open-Source-Classes/blob/master/Hologram/Hologram.php