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

open inventory

Comments in 'Plugin Development' started by PaulchenHD, Mar 23, 2016.

  1. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    PHP:
    public function onCommand(CommandSender $senderCommand $cmd$label, array $args) {
      switch (
    $cmd->getName())  {
      case 
    "test":
      if(
    $sender instanceof Player){
      
    $sender->sendMessage("Openning inventory");
      
    $sender->addWindow($sender->getInventory());
      }
      }
    i have try this but doesnt work ! :c
  2. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    PHP:
    public function onCommand(CommandSender $senderCommand $cmd$label, array $args) {
      switch (
    $cmd->getName())  {
      case 
    "test":
      if(
    $sender instanceof Player){
      
    $sender->sendMessage("Openning inventory");
      
    $sender->getInventory()->open($sender);
      }
      }
    ?
  3. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    noe :'D
  4. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    addWindow
  5. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Can you read the post before answering? He uses addWindow, it currently gives me an error too.
  6. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
  7. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Was replying to second post
    Last edited: Mar 26, 2016
  8. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    He used addWindow before that post.

Share This Page

Advertisement