Easy Question

Discussion in 'Plugin Development' started by JJSfluffyduck, Oct 5, 2012.

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

    JJSfluffyduck

    How do i make a lightbot fire at a location?
     
  2. Offline

    KeybordPiano459

    world.strikeLightning(Location loc)
     
    JJSfluffyduck likes this.
  3. Offline

    JJSfluffyduck

    thanks

    nest question how would i get a list of player that are online

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  4. Offline

    KeybordPiano459

    Wish I had my laptop, I would need to reference the source code that I have in another plugin in eclipse =/
     
  5. Offline

    CorrieKay

    Bukkit.getOnlinePlayers()
     
  6. Offline

    nicho96

    You could save all players during PlayerLoginEvent to an array list, and remove them from the array list on PlayerQuitEvent. Then just access that array list.
     
    JJSfluffyduck likes this.
  7. Offline

    MrFigg

  8. Offline

    JJSfluffyduck

    but how would i get the location of everyplayer on that server
     
  9. Offline

    CorrieKay

    for(Player p : Bukkit.getOnlinePlayers()){
    p.getLocation(); //location of each player, one after the other.
    }
     
  10. Offline

    JJSfluffyduck

    On a PlayerDeathEvent How you get the players name

    Because you cant get Player player = event.getPlayer

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  11. Offline

    Timr

  12. Offline

    CorrieKay

    event.getEntity() returns a player object.
     
Thread Status:
Not open for further replies.

Share This Page