A PocketMine-MP plugin to get player height location relative to sea level using command.
Command: /height
Permission: height.command
(Default: true
)
Get self height location relative to sea level (only works if command sender is an online player): /height
Get a player height location relative to sea level: /height <player>
(Example: /height KygekDev
to get height location of player KygekDev relative to sea level)
- Stable version (Recommended): Latest | All releases
- Build version (For advanced users): Poggit CI
Description
Gets player's height location (Y coordinate) relative to sea level
Synopsis
public static getHeight(Player $player, int $precision = 1) : float
Parameters
Player $player
: ThePlayer
object to get height location ofint $precision = 1
: Number of decimal places to pass to theround()
function
Returns
float
: Player's Y coordinate relative to sea level
Example
use KygekDev\Height\Height;
use pocketmine\Server;
$player = Server::getInstance()->getPlayerExact("KygekDev");
$name = $player->getName();
// 2 decimal places (.xx)
$height = Height::getHeight($player, 2);
$heightString = $height >= 0 ? $height . "m above" : abs($height) . "m below";
$player->sendMessage("Player $name is $heightString sea level");
This plugin is made by KygekDev and licensed under GPL-3.0.
- Please submit an issue if you want to give suggestions or report bugs.
- Join KygekDev Community Discord server for latest news from KygekDev and support from KygekDev or its members.