.

Discussion in 'Plugin Development' started by elementalgodz11, Oct 29, 2013.

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

    elementalgodz11

    .
     

    Attached Files:

  2. Offline

    xViiRuZ

    Try with
    if (player.getInventory().firstEmpty() == -1) {
    player.sendMessage("Inventory is full");
    return true;
    }
     
  3. elementalgodz11 Try:
    Code:java
    1. if (player.getInventory().firstEmpty() == -1){
    2. //Inv is full
    3. } else {
    4. player.getInventory().setItem(player.getInventory().firstEmpty(), YOUR_ITEM_HERE);
    5. }

    and put that anywhere you will be doing:
    Code:java
    1. player.getInventory().setItem(player.getInventory.firstEmpty(), itemstack);
     
  4. He could also use:
    Code:java
    1. Player p = e.getPlayer();
    2. if (p.getInventory().firstEmpty() == -1){
    3. return false;
    4. }
     
  5. elementalgodz11

    Not sure if anyone noticed this before but the image of the stack trace says that the error is being thrown from your player listener on PlayerDeathEvent, however, you posted code from your onCommand event. The error is being thrown from line 146 of your Player listener class. Please post the entire method, not just line 146.
     
  6. hamzaxx
    That's almost exactly what xViiRuZ posted

    mrkirby153
    I was responding to:
     
Thread Status:
Not open for further replies.

Share This Page