Error RING), expecting function (T_FUNCTION) or const (T_CONST)" (EXCEPTION) in "commandexecuter src/Command/Main" at line 27 Code <?php namespace Command; use pocketmine\Player; use pocketmine\Server; use pocketmine\item\Item; use pocketmine\event\PlayerJoinEvent; use pocketmine\event\Listener; use pocketmine\event\player\PlayerInteractEvent; use pocketmine\plugin\PluginBase; class Main extends PluginBase implements Listener { public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->getLogger()->sendMessage("Command executer is now Enabled"); } public function onDisable() { $this->getLogger()->sendMessage("Command executer is now disabled"); } public function onJoin(PlayerJoinEvent $event){ $custom == Item::get(340, 0, 1); $customName =$custom->setCustomName("§l§4SHOP"); $player->getInventory()->getItem($custom); } public function onInteract(PlayerInteractEvent $event) { $player = $event->getPlayer(); $item = $event->getItem(); if($item->getId() == 340) { $event->setCancelled(); $command = "shop"; $this->getServer()->dispatchCommand($player, $command); } ?>
$custom == Item::get(340,0,1); to $custom = Item::get(340,0,1); your forgot a = if you use an condition you can use this operator == etc.. when you defined a variable use "=" please. Please Read the Line it's easy....
No that .... PHP: $player->getInventory()->getItem($custom);//To$player->getInventory()->addItem($custom);