Hi my name is jerlegoman and I am developing an code but there is an error but I don't see anything wrong with here is my code: PHP: <?php/*__PocketMine Plugin__name=TOspawnversion=1.0apiversion=12author=Jerlegomanclass=Magic*/class Magic implements Plugin {private $api;public function __construct(ServerAPI $api,$server = false) {$this->api = $api;}public function init() {$this->api->addHandler("player.action", array($this, "eventHandle"), 50);}public function eventHandle($data, $event) {switch ($event) {case "player.action":$player = $data["player"];$item = $player->getSlot($player->slot);if($item->getid()==344){$player->entity->dropItem("264")}}}public function __destruct() {}} the error is on line 25 here is the error in console: Parse error: syntax error, unexpected '}' in C:\Users\Jeremy Haft\Desktop\PocketMine-MP use only\plugins\DP.php on line 25
I found your Problem! You forgot a Semicolon ";" on line 24 PHP: <?php/*__PocketMine Plugin__name=TOspawnversion=1.0apiversion=12author=Jerlegomanclass=Magic*/class Magic implements Plugin {private $api;public function __construct(ServerAPI $api,$server = false) {$this->api = $api;}public function init() {$this->api->addHandler("player.action", array($this, "eventHandle"), 50);}public function eventHandle($data, $event) {switch ($event) {case "player.action":$player = $data["player"];$item = $player->getSlot($player->slot);if($item->getid()==344){$player->entity->dropItem("264"); //You had before no semicolon}}}public function __destruct() {}}
now if you wanted to add a config to the dropitem would you do $player->entity->dropItem(".$this->config->get("itemID".");