See Inventory Help!

Discussion in 'Plugin Development' started by BILLIlike, Nov 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    BILLIlike

    Hi, my name's BILLIlike:

    I wanna know how to make a simple code to see the another players Inventory.

    On my code i use:

    Code:java
    1. Player player = (Player) sender;
    2. player.getOpenInventory();


    But Doesn't Works :S
     
  2. Offline

    timtower Administrator Administrator Moderator

    BILLIlike player.openInventory(otherplayer.getInventory());
     
  3. Offline

    mine-care

    BTW Make sure you check before the cast:
    Player player =(Player) sender;
     
    ChipDev likes this.
  4. Offline

    BILLIlike

    Thanks but i dont use "instaceof". These have a lot of bugs
     
  5. Offline

    timtower Administrator Administrator Moderator

    BILLIlike
    if(!(sender instanceof Player)){
    //is console
    }
     
  6. Offline

    Googlelover1234

    mine-care likes this.
  7. Offline

    mine-care

  8. Offline

    mrCookieSlime

    Removed Offtopic Discussion which got out of control and resulted in cursing.
    Please keep the Thread clean and be nice and friendly to each other.
     
  9. Offline

    Funergy

  10. Offline

    BILLIlike

    Look This...

    [​IMG]
     
  11. Offline

    timtower Administrator Administrator Moderator

    BILLIlike Never just copy paste stuff, you need a variable from the other player first.
     
    Skionz likes this.
  12. Offline

    Skionz

    BILLIlike Is "otherplayer" a real variable or did you just copy code and assume it would work?
     
  13. Offline

    BILLIlike

    I copy the code :s Can you send me a code with the variable?
     
  14. Offline

    Gater12

    BILLIlike
    No, the aim for programming to create (useful?) things yourself.

    Take a look here. It will be useful.
     
    ChipDev likes this.
  15. Offline

    Skionz

    BILLIlike I suggest filling out a plugin request.
     
Thread Status:
Not open for further replies.

Share This Page