I have make a small plugin but i have problem With funtion Main.php: https://ghostbin.com/paste/vebjx ( sorry i m noob. I have started to learn php since 3days °^° )
This fixes it PHP: <?phpnamespace KiT;use pocketmine\plugin\PluginBase;use pocketmine\Player;use pocketmine\Server;use pocketmine\event\Listener;use pocketmine\utils\TextFormat as C;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\permission\Permission;use pocketmine\item\item;use pocketmine\inventory\BaseInventory;use pocketmine\item\enchantment\Enchantment;use pocketmine\command\ConsoleCommandSender;use pocketmine\math\Vector3;use pocketmine\event\player\PlayerInteractEvent;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\level\sound\{ TNTPrimeSound};class Main extends PluginBase implements Listener{ public function onLoad(){ $this->getLogger()->info("Plugin Loading"); } public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this,$this); $this->getLogger()->info("Enabled Plugin"); } public function onDisable(){ $this->getLogger()->info("Plugin Disabled"); } public function onJoin(PlayerJoinEvent $event){ $player = $event->getPlayer(); $name = $player->getName(); $this->getServer()->broadcastMessage(C::GREEN."$name Joined The Server! Awesome!"); } public function onCommand(CommandSender $sender, Command $command, $label, array $args) { switch ($command->getName()) { case 'kit': $sender->getInventory()->addItem(Item::get(388, 0, 1)); $sender->sendPopup('kit du demon'); break; } } public function onTouch(PlayerInteractEvent $event){ $player = $event->getPlayer(); $name = $player->getName(); if($player->getInventory()->getItemInHand()->getId() == 388) { $set1 = Item::get(310, 0, 1); $set2 = Item::get(311, 0, 1); $set3 = Item::get(312, 0, 1); $set4 = Item::get(313, 0, 1); $set5 = Item::get(276, 0, 1); $set6 = Item::get(466, 0, 16); $player->getInventory()->removeItem(Item::get(388,0,1)); $player->getLevel()->addSound(new TNTPrimeSound(new Vector3($player->x,$player->y,$player->z))); }