how can i get pocketmine to send the heal of another player to a player who used a command im stuck here- btw i like using the switch function PHP: case "health": if($sender instanceof Player) { $sender->sendMessage $player->Entity::getHealth(); } endswitch;
Try something more like this: Code: if($entity instanceof Player){ $sender->sendmessage("The player ".$player->getname();." has".$player->getHealth(); . "/20 lives"); } else{ $sender->sendMessage("The player doesn't exist"); And your config file will have to be somewhat like this: commands: health: description: "Gets the amount of health of a player" usage: "/health <player>" aliases: "h" permission: health.allow
you could also do something like this: PHP: $lol = $player->getName()->getHealth();$sender->sendMessage($lol);
is this right? PHP: case "health": //This is to get the health of the player// if($entity instanceof Player){ $sender->sendmessage("The player ".$player->getname()." has".$player->getHealth() . "/20 lives"); break; } else { $sender->sendMessage("The player doesn't exist"); break; } endswitch;