PHP: <?phpnamespace Julooooos\Guerilla;use pocketmine\Server;use pocketmine\Player;use pocketmine\plugin\PluginBase;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\scheduler\PluginTask;use pocketmine\utils\TextFormat;use pocketmine\item\Item;use pocketmine\entity\Effect;use pocketmine\level\Position;use pocketmine\level\Level;use pocketmine\utils\Config;use pocketmine\math\vector3;use pocketmine\level\sound\GhastSound;use pocketmine\level\sound\ClickSound;use pocketmine\level\sound\AnvilUseSound;class Countdown extends PluginTask { private $countdown = 0; public function __construct(Main $plugin) { parent::__construct($plugin); class Main extends PluginBase implements Listener { public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool { switch($cmd->getName()){ case "guerilla": if($sender instanceof Player) { if($sender->hasPermission("guerilla.start")){ foreach($this->getOwner()->getServer()->getOnlinePlayers() as $player) { foreach($this->getServer()->getLevel("world")->getTime() as $time) { $sender->getLevel()->setTime(0); $this->getServer()->broadcastMessage("Message") if($time === 20) { $player->sendMessage("Message"); $click = new ClickSound($player); $player->getLevel()->addSound($click); } if($time === 40) { $player->sendMessage->("Message") $click = new ClickSound($player); $player->getLevel()->addSound($click); } if($time === 60) { $player->sendMessage("Message"); $click = new ClickSound($player); $player->getLevel()->addSound($click); } if($time === 80) { $player->sendMessage("Message"); $player->getLevel()->addSound(new AnvilUseSound($pl)); } } } } } }}
the plugin doesn't work, this is the console error : [36m[19:56:35] [m[31m[Server thread/CRITICAL]: ParseError: "syntax error, unexpected 'if' (T_IF)" (EXCEPTION) in "Mon plugin/src/Julooooos/Guerilla/Main" at line 41[m
do not worry, this mistake of forgetting the ; is very frequent in programming, if you have never forgotten one, you can not say that you are a programmer. hehe
PHP: $this->getServer()->broadcastMessage("Message") //hereif($time === 40) { $player->sendMessage->("Message") //here $click = new ClickSound($player); $player->getLevel()->addSound($click);} missing semicolon " ; "