-
Notifications
You must be signed in to change notification settings - Fork 18
What are Scenarios?
Scenarios for UHC are like plugins for server.
Download them then put them in your scenarios folder to add them.
To add a scenario to your UHC game, you need to be in waiting for more players, then type “/uhc scenarios add \”
Requirements:
- PHP knowledges. You can learn it on CodeAcademy
- Some pocketmine API knowledeges that are essentials to know how to code it.
If you know all those, let’s start:
First, create a new File that will be your scenario code named “YOUR_SCENARIO_NAME.php”.
Then, you’ll need to add the class that will be your main class. So to do that, add some code inside:
<?php
# This is an example !
class YOUR_SCENARIO_NAME extends \Ad5001\UHC\scenario\Scenario {
}
Great ! Now you know that, let’s learn a bit about the functions of the API:
Function name | Function parameters | Description |
onEnable | none | Execute the code when the game start ! |
onStop | none | Execute the code when the game finish |
getConfig | none | Return you the params of the scenario’s config |
getServer | none | Return you the Server instance |
reloadConfig | none | Reload the config |
saveConfig | config | Save all the args you want in the config |
getScenarioFolder | none | Get the path/folder of the scenarios. |
(c) Ad5001 2016. This plugin is under the BoxOfDevs Public General License v1.1.1