HungerGames
=============
BIG NOTE
COMPILING IT WITH pmt.mcpe.me WILL MAKE THE PLUGIN CORRUPTED. DOWNLOAD FROM RELEASES HERE
A HungerGames plugin for PocketMine-MP developed by xBeastMode
#New Features? Yes, of course. You can choose between SkyWars or HungerGames! How? You can make a game with the following command: /hg add Then, run the command "/reload", and check the config inside the folder "arenas", inside the plugin folder. Configure it to your needs, there you will find the "is_sky_wars" option, set it to true to make it skywars ;)
Watch my YouTube video showing bow to setup a game arena:
When you join a game the plugin will automatically backup the map.
- Other features: Scripts have been added. I did not make any scripts for it yet, maybe in the future.
#Future updates? I am planning to adding many more features to this plugin, if you wish me to add one, please say it in issues, thank you.
- For Devs:
This plugin comes with a script loader api. You can use this to access game functions, like when player joins, quits, wins, etc. You do not need to enable it, as it loads itself.
If you wish to create one here's an example code:
Click here to view example:
//Example script:
<?php
class ExampleScript extends \hungergames\api\scripts\HGAPIScript{
public function __construct(){
parent::__construct("Script names here", "Versions here 1.0", "Authors here xBeastMode");
}
public function onLoad(){
$this->sendConsoleMessage("Test script loaded!");
}
}
//All function from this script api are:
/**
* Creates script config
*
* @param $name
* @param array $values
* @return Config
*/
public void function createConfig($name, array $values)
/**
* Gets script config
*
* @return Config
*/
public Config function getConfig()
/**
* Gets the name of the script
*
* @return string
*/
public string function getName()
/**
* Gets the name of the script
*
* @return string
*/
public string function getVersion()
/**
* Gets the author of the script
*
* @return string
*/
public string function getAuthor()
/**
* disables script
*/
public void function setDisabled()
/**
* enables script
*/
public void function setEnabled();
/**
* returns whether script is enabled or not
*
* @return bool
*/
public bool function isEnabled()
/**
* Sends console message
*
* @param $message
*/
public void function sendConsoleMessage($message)
/**
* Called when script is loaded
*/
public function onLoad(){
//your code here
}
/**
* called when player joins game
*
* @param Player $p
* @param HungerGames $game
*/
public function onPlayerJoinGame(Player $p, HungerGames $game){
//your code here
}
/**
* called when player quits game
*
* @param Player $p
* @param HungerGames $game
*/
public function onPlayerQuitGame(Player $p, HungerGames $game){
//your code here
}
/**
* Called when player fails to join full game
*
* @param Player $p
* @param HungerGames $game
*/
public function gameIsFull(Player $p, HungerGames $game){
//your code here
}
/**
* Called when player is waiting for players
*
* @param array $players
* @param HungerGames $game
*/
public function whileWaitingForPlayers(array $players, HungerGames $game){
//your code here
}
/**
* Called when player is waiting for players
*
* @param array $players
* @param HungerGames $game
*/
public function whileWaitingToStart(array $players, HungerGames $game){
//your code here
}
/**
* Called when game starts
*
* @param array $players
* @param HungerGames $game
*/
public function onGameStart(array $players, HungerGames $game){
//your code here
}
/**
* Called when death match starts
*
* @param array $players
* @param HungerGames $game
*/
public function onDeathMatchStart(array $players, HungerGames $game){
//your code here
}
/**
* Called when players wins a game
*
* @param Player $p
* @param HungerGames $game
*/
public function onPlayerWinGame(Player $p, HungerGames $game){
//your code here
}
Click here to view example:
//Example script:
<?php
class ExampleScript extends \hungergames\api\scripts\HGAPIScript{
public function __construct(){
parent::__construct("Script names here", "Versions here 1.0", "Authors here xBeastMode");
}
public function onLoad(){
$this->sendConsoleMessage("Test script loaded!");
}
}
//All function from this script api are:
/**
* Creates script config
*
* @param $name
* @param array $values
* @return Config
*/
public void function createConfig($name, array $values)
/**
* Gets script config
*
* @return Config
*/
public Config function getConfig()
/**
* Gets the name of the script
*
* @return string
*/
public string function getName()
/**
* Gets the name of the script
*
* @return string
*/
public string function getVersion()
/**
* Gets the author of the script
*
* @return string
*/
public string function getAuthor()
/**
* disables script
*/
public void function setDisabled()
/**
* enables script
*/
public void function setEnabled();
/**
* returns whether script is enabled or not
*
* @return bool
*/
public bool function isEnabled()
/**
* Sends console message
*
* @param $message
*/
public void function sendConsoleMessage($message)
/**
* Called when script is loaded
*/
public function onLoad(){
//your code here
}
/**
* called when player joins game
*
* @param Player $p
* @param HungerGames $game
*/
public function onPlayerJoinGame(Player $p, HungerGames $game){
//your code here
}
/**
* called when player quits game
*
* @param Player $p
* @param HungerGames $game
*/
public function onPlayerQuitGame(Player $p, HungerGames $game){
//your code here
}
/**
* Called when player fails to join full game
*
* @param Player $p
* @param HungerGames $game
*/
public function gameIsFull(Player $p, HungerGames $game){
//your code here
}
/**
* Called when player is waiting for players
*
* @param array $players
* @param HungerGames $game
*/
public function whileWaitingForPlayers(array $players, HungerGames $game){
//your code here
}
/**
* Called when player is waiting for players
*
* @param array $players
* @param HungerGames $game
*/
public function whileWaitingToStart(array $players, HungerGames $game){
//your code here
}
/**
* Called when game starts
*
* @param array $players
* @param HungerGames $game
*/
public function onGameStart(array $players, HungerGames $game){
//your code here
}
/**
* Called when death match starts
*
* @param array $players
* @param HungerGames $game
*/
public function onDeathMatchStart(array $players, HungerGames $game){
//your code here
}
/**
* Called when players wins a game
*
* @param Player $p
* @param HungerGames $game
*/
public function onPlayerWinGame(Player $p, HungerGames $game){
//your code here
}
=== BIG NOTE: after every change you will have to run the command /reload
Commands:
-
/hg add : adds a new game
- OP perm: hg.command.add
-
/hg del : deletes a game
- OP perm: hg.command.del
-
/hg min : changes the number of minimum players required to start a game
- OP perm: hg.command.min
-
/hg max : changes number of maximum players that can enter a game
- OP perm: hg.command.max
-
/hg level : changes level of game where players are gonna go
- OP perm: hg.command.level
-
/hg ws : sets amount of seconds to wait before game starts
- OP perm: hg.command.ws
-
/hg gs : sets amount of second to wait before death match starts
- OP perm: hg.command.gs
-
/hg addslot : adds new slot to game (positions sets where you are standing)
- OP perm: hg.command.slot.add
-
/hg delslot : deletes slot from game by name
- OP perm: hg.command.slot.del
-
/hg leave : leaves game that you are playing
- OP perm: none