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

clear a person inv?

Comments in 'Plugin Development' started by Xfusionios, Sep 14, 2013.

  1. Xfusionios
    Offline

    Xfusionios Active Member Plugin Developer

    Joined:
    Aug 24, 2013
    Posts:
    67
    Plugins:
    2
    Minecraft User:
    XFusionios
    Whats the code to clear a persons inv? Thanks..
    -Xfusionios
  2. Killman2
    Offline

    Killman2 Active Member Plugin Developer

    Joined:
    May 5, 2014
    Posts:
    81
    Plugins:
    1
    Minecraft User:
    Killman2
    Use

    PHP:
          public function inventoryClean($cmd$params$issuer$alias$args$issuer)
          {
             
    $username $params[0];
             if(
    $username === '' && $username === null)
                return 
    "use /inventory clean ";

             
    $player $this->api->player->get($username);
             if(! (
    $player instanceof Player) and ! ($player->entity instanceof Entity)) {
    return 
    "player not found.";
             }
             
    $player->inventory = array();
             
    $player->sendInventory();
          }

          
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The instanceof line should be or not and.

Share This Page

Advertisement