Invintory Help

Discussion in 'Plugin Development' started by thecrystalflame, Jul 28, 2013.

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

    thecrystalflame

    A piece of a plugin i am currently working on requires me to check if there is 64 or more of each Wood types in the players inventory.
    for example i need to learn how to check if a player has 64 spruce wood logs in their inventory be it in a single stack or spread out between many.
    I have attempted to go about this many ways, all of them ending in failure

    Code:java
    1.  
    2. if (player.getInventory().contains(new ItemStack(Material.WOOD, 1, (short) 2) 64)) {
    3. }
    4. ///////////////
    5. if (player.getInventory().contains(Material.WOOD, 64) {
    6. }// this can tell me if there is at least 64 wood planks in the inventory but is not discriminant towards
    7. //type which is what i am looking for
    8.  


    any help appreciated
     
  2. Offline

    Nitnelave

    what's the problem with the first one?
     
Thread Status:
Not open for further replies.

Share This Page