Solved is this right

Discussion in 'Plugin Development' started by Ethan Rocks 365, Feb 28, 2016.

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

    Ethan Rocks 365

    This
    Code:
    private void consumeMissile(Player player)
      {
        PlayerInventory inv = player.getInventory();
        int index = inv.first(this.consumeItem);
        ItemStack item = inv.getItem(index);
        int amount = item.getAmount() - 1;
        if (amount <= 0) {
          inv.setItem(index, null);
        } else {
          item.setAmount(amount);
        }
      }
      
    causes the missile to take dmg each time it shoots right
     
  2. Offline

    teej107

  3. Offline

    Ethan Rocks 365

    Cant right now. Im locked out of my programming pc
    #ThnxDad
     
  4. Offline

    MOMOTHEREAL

    @Ethan Rocks 365
    Wouldn't the use of inv.removeItem(item) be more suitable rather than setting the slot to null?
     
  5. Offline

    Ethan Rocks 365

    @MOMOTHEREAL I modifying something

    Can someone tell me if it does or not I'm just changing this ITS NOTMINE
     
  6. Offline

    teej107

    What do I look like? The JVM? You test it. The complete code is on your machine.
     
    HoeMC likes this.
  7. Offline

    HoeMC

    Hey, I tested it for you.

    I got this error:
    Code:
    Error: Main method not found in class test.Test, please define the main method as:
    
       public static void main(String[] args)
    or a JavaFX application class must extend javafx.application.Application
    
    I wonder what the problem could be...
     
    teej107 likes this.
  8. Offline

    Ethan Rocks 365

    Thanks for testing. I will figure that out. Marked as: sovled by: OP(EthanRocks365)
     
Thread Status:
Not open for further replies.

Share This Page