I use the Google translator. I got a problem: when a player enters a command, you need to know his position. I do not understand how to do it. So? $position = new Position; $x = $position->getX(); And so on?
if broken unit? So? public function BlockBreakEvent(BlockBreakEvent $event) { $user = $event->getPlayer(); $x = $event->getX(); $x = $event->getY(); $x = $event->getZ(); }
PHP: public function blockBreakEvent(BlockBreakEvent $event){ $playerX = $event->getPlayer()->getFloorX(); $playerY = $event->getPlayer()->getFloorY(); $playerZ = $event->getPlayer()->getFloorZ(); $blockX = $event->getBlock()->getFloorX(); $blockY = $event->getBlock()->getFloorY(); $blockZ = $event->getBlock()->getFloorZ();}
Functions names should be like onBlockBreaked onBlockBreak onBlockBreakEventCalled These are good examples, although a bit long. Using same class names and function names is just tricking yourself.
I know! I can not imagine what I would do in the summer, if not PocketMine! But sometimes, when all else fails, I fall into despair) I did not understand where you get methods getPlayer (), getFloorZ (); they're not built