Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

InventoryClear v2.0.0

Clear players inventory on Join, Leave, Death and with a command!

  1. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    CrazedMiner submitted a new plugin:

    InventoryClear - Clear players inventory on Join, Leave, Death and with a command!

    Read more about this plugin...
    JDTech likes this.
  2. JDTech
    Offline

    JDTech New Member

    Joined:
    May 1, 2015
    Posts:
    18
    The players inventory is cleared as they die right? They don't drop anything?
  3. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    There's options in the Config.yml that you can set to true or false for Player Join, Leave and Death.
  4. JDTech
    Offline

    JDTech New Member

    Joined:
    May 1, 2015
    Posts:
    18
    Just wanted to make sure that the players inventory is cleared before the players inventory is dropped.
  5. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    Yep, it sets their drops to nothing
  6. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
  7. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    253
    Minecraft User:
    CaptainKenji17
    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::DARK_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
  8. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    253
    Minecraft User:
    CaptainKenji17
    once you fix please DM me the fixed one :) because I cant wait for PM plugin submission accept
  9. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    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.
  10. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    253
    Minecraft User:
    CaptainKenji17
    how?
  11. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    253
    Minecraft User:
    CaptainKenji17
    nvm i got it
  12. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    253
    Minecraft User:
    CaptainKenji17
    even you disable join clear of leave clear its keep crashing
  13. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    Crash dump?
  14. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    253
    Minecraft User:
    CaptainKenji17
    look up.... its same crash dump
  15. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    i've created a pull request in your plugin :)
  16. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    how about this:
    Code:
    public function clearInventory($player){
         if($player instanceof Player){
              $player->getInventory()->clearAll();
         }
    }
    
    safer.
    CrazedMiner and CaptainKenji17 like this.
  17. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    253
    Minecraft User:
    CaptainKenji17

    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::DARK_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
  18. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    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.
    CaptainKenji17 likes this.
  19. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    I've gotta update the GitHub version to v1.2 :p
  20. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    253
    Minecraft User:
    CaptainKenji17
    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::DARK_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()
    CrazedMiner likes this.

Share This Page

Advertisement