Code: 28.04 19:56:06 [Server] CRITICAL ParseError: "syntax error, unexpected 'onInventory' (T_STRING)" (EXCEPTION) in "/Menus/src/TB/Main" at line 57 this is my error PHP: public function sendChestInventory(Player $player){ $nbt = new CompoundTag('', [ new StringTag('id', Tile::CHEST), new IntTag('Chest', 1), new IntTag('x', floor($player->x)), new IntTag('y', floor($player->y) - 4), new IntTag('z', floor($player->z)) ]); /** @var Chest $tile */ $tile = Tile::createTile('Chest', $player->getLevel(), $nbt); $block = Block::get(Block::CHEST); $block->x = floor($tile->x); $block->y = floor($tile->y); $block->z = floor($tile->z); $block->level = $tile->getLevel(); $block->level->sendBlocks([$player], [$block]); $test = Item::get(279, 0, 1); $test->setCustomName("TEST"); $tile->getInventory()->setItem(0, $test); $player->addWindow($tile); }}line 57 right herepublic function onInventory(InventoryTransactionEvent $event) {
Code: 28.04 20:14:24 [Server] CRITICAL ParseError: "syntax error, unexpected 'public function' (T_STRING), expecting function (T_FUNCTION)" (EXCEPTION) in "/Menus/src/TB/Main" at line 56
Please note this is a PMMP API forum not PHP syntax help forum we will still welcome you at face palm section
The only think that I can think of may be a misplaced } PHP: public function sendChestInventory(Player $player){ $nbt = new CompoundTag('', [ new StringTag('id', Tile::CHEST), new IntTag('Chest', 1), new IntTag('x', floor($player->x)), new IntTag('y', floor($player->y) - 4), new IntTag('z', floor($player->z)) ]); /** @var Chest $tile */ $tile = Tile::createTile('Chest', $player->getLevel(), $nbt); $block = Block::get(Block::CHEST); $block->x = floor($tile->x); $block->y = floor($tile->y); $block->z = floor($tile->z); $block->level = $tile->getLevel(); $block->level->sendBlocks([$player], [$block]); $test = Item::get(279, 0, 1); $test->setCustomName("TEST"); $tile->getInventory()->setItem(0, $test); $player->addWindow($tile);}public function onInventory(InventoryTransactionEvent $event) {