-
-
Notifications
You must be signed in to change notification settings - Fork 8
The basics of the API
The classic and fully customizable minigame fun to play for PocketMine-MP.
Since Beta 1.4, the API has been rewrote with a lot of new stuff to get the kills, the last damager and to check if an option is enabled and disabled.
To get the kills of a player, you just need to use the API::getKills
function with the player you want to get the kills from:
$player = $event->getPlayer();
ItzLightyHD\KnockbackFFA\API::getKills($player);
You'll either get an integer value or a string value that contains "none".
When the player gets hit by another player, the game saves the last damager. To get the last damager, just use the API::getLastDmg
function like shown here:
$player = $event->getPlayer();
ItzLightyHD\KnockbackFFA\API::getLastDmg($player);
You'll either get the exact player or a string value that contains "none".
You might find useful to check what options are enabled and what aren't. All the functions return a bool value, so you should check if the function returns either true or false. These are the following functions:
-
API::isMassiveKnockbackEnabled
-> Checks if the massive knockback option is enabled -
API::isBowEnabled
-> Checks if the bow is enabled -
API::isSnowballsEnabled
-> Checks if the snowballs are enabled -
API::isLeapEnabled
-> Checks if the leap is enabled -
API::isDoubleJumpEnabled
-> Checks if double jump is enabled