/** * @param CommandSender $sender * @param Player $player */ public function sendPlayerInfo(CommandSender $sender, IPlayer $player) { $sender->sendMessage("Name: " . $player->getName()); $sender->sendMessage("Display-name: " . $player->getDisplayName()); $sender->sendMessage("Nametag: " . $player->getNameTag()); $sender->sendMessage("Address: " . $player->getAddress() . ":" . $player->getPort()); $sender->sendMessage("Client-id: " . $player->getClientId()); $sender->sendMessage("Entity-id: " . $player->getId()); $sender->sendMessage("Unique-id: " . $player->getUniqueId()); $sender->sendMessage("Health: " . $player->getHealth() . "/" . $player->getMaxHealth()); $sender->sendMessage("XYZ: " . $player->getFloorX() . ":" . $player->getFloorY() . ":" . $player->getFloorZ()); $sender->sendMessage("Level: " . $player->getLevel()->getName()); $sender->sendMessage("Yaw: " . $player->getYaw()); $sender->sendMessage("Pitch: " . $player->getPitch()); $sender->sendMessage("Gamemode: " . $player->getGamemode()); $sender->sendMessage("Is-sleeping: " . ($player->isSleeping() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-inside-water: " . ($player->isInsideOfWater() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-inside-solid: " . ($player->isInsideOfSolid() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-on-ground: " . ($player->isOnGround() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-on-fire: " . ($player->isOnFire() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); //$sender->sendMessage("Is-sneaking: ".($player->isSneaking() ? TextFormat::GREEN."yes" : TextFormat::RED."no")); //$sender->sendMessage("Is-sprinting: ".($player->isSprinting() ? TextFormat::GREEN."yes" : TextFormat::RED."no")); $sender->sendMessage("Is-skin-slim: " . ($player->isSkinSlim() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-nametag-visible: " . ($player->isNameTagVisible() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-online: " . ($player->isOnline() ? TextFormat::GREEN . "yes" : "no")); $sender->sendMessage("Is-connected: " . ($player->isConnected() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-valid: " . ($player->isValid() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-alive: " . ($player->isAlive() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-op: " . ($player->isOp() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-banned: " . ($player->isBanned() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-exempt: " . ($this->plugin->isExempted($player) ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-name-whitelisted: " . ($player->isWhitelisted() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-ip-whitelisted: " . ($this->plugin->isAddressWhitelisted($player->getAddress()) ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $effectCount = 0; $effectNames = ""; foreach ($player->getEffects() as $effect) { $effectNames .= $effect->getName() . ", "; $effectCount++; } $sender->sendMessage("Effects (" . $effectCount . "): " . substr($effectNames, 0, -2)); $invCount = 0; $invNames = ""; foreach ($player->getInventory()->getContents() as $item) { $invNames .= $item->getName() . ", "; $invCount++; } $sender->sendMessage("Items (" . $invCount . "): " . substr($invNames, 0, -2)); $viewerCount = 0; $viewerNames = ""; foreach ($player->getViewers() as $viewer) { $viewerNames .= $viewer->getName() . ", "; $viewerCount++; } $sender->sendMessage("Viewers (" . $viewerCount . "): " . substr($viewerNames, 0, -2)); }