Skip to content

The basics of the API

ItzLightyHD edited this page Jul 20, 2022 · 4 revisions


The classic and fully customizable minigame fun to play for PocketMine-MP.

Poggit Release GitHub tag (latest release) Discord Ko-Fi

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.

Getting the kills of a player

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".

Getting the last player damager

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".

Checking the game configuration

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
Clone this wiki locally