CrazedMiner submitted a new plugin: InventoryClear - Clear players inventory on Join, Leave, Death and with a command! Read more about this plugin...
There's options in the Config.yml that you can set to true or false for Player Join, Leave and Death.
Just wanted to make sure that the players inventory is cleared before the players inventory is dropped.
CrazedMiner updated InventoryClear with a new update entry: InventoryClear v1.2 release! Read the rest of this update entry...
I thought it's fixed but not PocketMine-MP Crash Dump Thu Jun 18 08:09:30 MDT 2015 Error: Call to a member function setContents() on null File: /InventoryClear_v1.2.phar/src/InventoryClear/Main Line: 59 Type: E_ERROR THIS CRASH WAS CAUSED BY A PLUGIN BAD PLUGIN: InventoryClear v1.2 Code: [50] [51] $this->getLogger()->info(TextFormat::GREEN . "InventoryClear v1.0 By CrazedMiner Enabled!"); [52] } [53] [54] public function onDisable() { [55] $this->getLogger()->info(TextFormat:ARK_GREEN . "InventoryClear v1.0 By CrazedMiner Disabled!"); [56] } [57] [58] public function clearInventory(Player $player) { [59] $player->getInventory()->setContents(array(Item::get(0, 0, 0))); [60] } [61] [62] public function clearDrops(Event $event) { [63] $event->setDrops(array(Item::get(0, 0, 0))); [64] } [65] [66] } [67] [68] [69] Backtrace: #0 (): pocketmine\Server->crashDump() PocketMine-MP version: 1.5dev #1231 [Protocol 27; API 1.12.0] Git commit: 0000000000000000000000000000000000000000 uname -a: Linux mc30.vgmc.us 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 x86_64 PHP Version: 5.6.2 Zend version: 2.6.0 OS : Linux, linux
Don't use the quit option, for some reason PocketMine doesn't like getting a players inventory after they leave. So just use the Join option instead.
how about this: Code: public function clearInventory($player){ if($player instanceof Player){ $player->getInventory()->clearAll(); } } safer.
Error: Cannot redeclare InventoryClear\Main::clearInventory() File: /FixINV/src/InventoryClear/Main Line: 62 Type: E_COMPILE_ERROR THIS CRASH WAS CAUSED BY A PLUGIN Code: [53] [54] public function onDisable() { [55] $this->getLogger()->info(TextFormat:ARK_GREEN . "InventoryClear v1.0 By CrazedMiner Disabled!"); [56] } [57] [58] public function clearInventory(Player $player) { [59] $player->getInventory()->setContents(array(Item::get(0, 0, 0))); [60] } [61] [62] public function clearInventory($player){ [63] if($player instanceof Player){ [64] $player->getInventory()->clearAll(); [65] } [66] } [67] [68] [69] [70] [71] [72] Backtrace: #0 (): pocketmine\Server->crashDump() PocketMine-MP version: 1.5dev #1252 [Protocol 27; API 1.12.0] Git commit: 0000000000000000000000000000000000000000 uname -a: Linux mc30.vgmc.us 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 x86_64 PHP Version: 5.6.2 Zend version: 2.6.0 OS : Linux, linux
Remove/replace the old one With my snippet above. it says right there on the error dump. omgggg. If you cant understand remove line 58 to 60.
fix please.... even josh code wont work PocketMine-MP Crash Dump Mon Jun 22 02:19:09 MDT 2015 Error: Call to a member function clearAll() on null File: /InventoryClear_v1.2.phar/src/InventoryClear/Main Line: 62 Type: E_ERROR THIS CRASH WAS CAUSED BY A PLUGIN BAD PLUGIN: InventoryClear v1.2 Code: [53] $this->getLogger()->info(TextFormat::GREEN . "InventoryClear v1.0 By CrazedMiner Enabled!"); [54] } [55] [56] public function onDisable() { [57] $this->getLogger()->info(TextFormat:ARK_GREEN . "InventoryClear v1.0 By CrazedMiner Disabled!"); [58] } [59] [60] public function clearInventory($player){ [61] if($player instanceof Player){ [62] $player->getInventory()->clearAll(); [63] } [64] } [65] [66] public function clearDrops(Event $event) { [67] $event->setDrops(array(Item::get(0, 0, 0))); [68] } [69] [70] } [71] [72] Backtrace: #0 (): pocketmine\Server->crashDump()