Last active
July 25, 2017 14:50
-
-
Save jasonw4331/40e3075a25d394357f7c562bc237b143 to your computer and use it in GitHub Desktop.
PMMP plugin script that clears inventories on player quit for UHC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @name InvClear | |
| * @main jasonwynn10\InvClear\MainClass | |
| * @version 0.1.0 | |
| * @api 3.0.0-ALPHA5 | |
| * @description A plugin script that clears inventories on player quit for UHC | |
| * @author jasonwynn10 | |
| */ | |
| namespace jasonwynn10\InvClear{ | |
| use pocketmine\event\Listener; | |
| use pocketmine\event\PlayerQuitEvent; | |
| use pocketmine\plugin\PluginBase; | |
| class MainClass extends PluginBase implements Listener { | |
| public function onEnable() { | |
| $this->getServer()->getPluginManager()->registerEvents($this, $this); | |
| } | |
| public function onQuit(PlayerQuitEvent $ev) { | |
| for($i = 0; $i <= $ev->getPlayer()->getInventory()->getSize(); $i++) { | |
| $ev->getPlayer()->getInventory()->clear($i); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment