Hello, so I wanted to make this plugin where if you interact with a compass it opens a test ui, but the code isn't working when I interact with the compass it loads theres no errors just doesn't work. Code: public function onTap (PlayerInteractEvent $event) { $player = $event->getPlayer(); $item = $player->getInventory()->getItemInHand()->getId(); if ($item == 345); $this->getServer()->dispatchCommand(new ConsoleCommandSender(), 'cui testsimple'); } }
Player PHP: $this->getServer()->dispatchCommand($player, "<say hello>"); console: PHP: $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "<boradcast this is a simple test>");
$this->getServer()->dispatchCommand($player, "<say this is a simpletest>"); Nothing happens when I interact with the compass still? theres no errors either "[Server thread/INFO]: Enabling Compass_ui v1"
ParseError: "syntax error, unexpected ''cui testsimple'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')'"
Read the error. You obviously forgot the comma. PHP is already giving very readable syntax error messages; what else could one ask for?
So i fixed this issue but it doesn't send the ui to the player, but when I put other commands it works.
Sorry to break the bad news to ya bud but the Original Poster of this thread probably won't ever reply. He quit developing and minecraft overall months ago Good luck searching!