How can i give all Players an Item?

Discussion in 'Plugin Development' started by iMiroLPs, May 4, 2013.

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

    iMiroLPs

    Hello,
    how can i give all players an item ???

    Thank You :)
     
  2. Offline

    chasechocolate

    Code:java
    1. ItemStack item = new ItemStack(Material.<ITEM>, <AMOUNT>);
    2.  
    3. for(Player online : Bukkit.getOnlinePlayers){
    4. online.getInventory().addItem(item);
    5. }
     
    zack6849 likes this.
  3. Offline

    MyNameIsHariK

    chasechocolate Im getting an error with this bit 'getOnlinePlayers'
     
  4. Offline

    scarletomato

    add parentheses ()... Bukkit.getOnlinePlayers();
     
  5. Offline

    chasechocolate

    MyNameIsHariK for starters, don't bump an old thread. Regarding your question, I made a typo, it should be "Bukkit.getOnlinePlayers()", with the extra "()" at the end.
     
  6. Offline

    calebbfmv

Thread Status:
Not open for further replies.

Share This Page