PHP: <?phpnamespace PopupDisplayer;use pocketmine\Player;use pocketmine\event\Listener;use pocketmine\plugin\PluginBase;use pocketmine\utils\TextFormat;use pocketmine\Server;use pocketmine\plugin\PluginManager;use pocketmine\plugin\Plugin;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\utils\Config;class Main extends PluginBase implements Listener{public $cfg; public function onLoad(){ $this->getLogger()->info("Plugin Attivato"); //getLogger() mostra il messaggio dopo info nella console di PM } public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); @mkdir($this->getDataFolder()); //crea la cartella dove sara il config.yml $this->saveDefaultConfig(); //salva la configurazione di default del config.yml $this->cfg = $this->getConfig(); //prende le informazioni dal config.yml } public function onPlayerJoin(PlayerJoinEvent $event){ $type = $this->cfg->get("type"); if($type === "tip"){ $message = $this->cfg->get("message"); $this->cfg->set("message",$message); $this->cfg->save(); $event->getPlayer()->sendTip($message); }elseif($type === "popup"){ $message = $this->cfg->get("message"); $this->cfg->set("message",$message); $this->cfg->save(); $event->getPlayer()->sendPopup($message); } }public function onDisable(){ unset($this->players); $this->saveDefaultConfig(); $this->getLogger()->info("Plugin Disattivato"); }}?>
Use scheduleRepeatingTask and repeat it every 7 seconds (I think this is the right amount of time to replace the PopUp before it disapears) **EDIT** Use scheduleRepeatingTask and repeat it every 7 ticks (I think this is the right amount of time to replace the PopUp before it disapears)