Death Event Triggering 4 Times and Spread Players

Discussion in 'Plugin Development' started by LordVakar, Mar 5, 2014.

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

    LordVakar

    So when somebody dies, it displays a message. For some reason, it broadcasts 4 messages for one death. Also, when they die they drop a head and they drop 4 heads for some reason.

    Also, how would I make a spread players in an area with Bukkit, but team members get spread together?
     
  2. Offline

    HungerCraftNL

    Make teams like this:
    PHP:
    ArrayList<Stringteam1 = new ArrayList<String>();
    Then add people when they get spread:
    PHP:
    Player p = ;//<--- Player
    team1.add(p.getName());
    And get all the players from that team and teleport them:
    PHP:
    Location location =  ; //<--- Location
    for(String s team1){
      
    Player p Bukkit.getPlayer(s);
      
    p.teleport(location);
    }
     
  3. Offline

    LordVakar

    What if I want it to be a random spread?
    And do you know what's happening with the death event?
     
  4. Offline

    Randy Schouten

    Show us some code.
     
  5. Offline

    unon1100

    Seems like they are dying 4 times to me. Can we see some code that could possibly be causing this?
     
  6. Offline

    HungerCraftNL

    Do you mean a random location or random teams?
     
  7. Offline

    LordVakar

    Random location.
    Yea, I'll post it either later today or tomorrow.
     
  8. Offline

    HungerCraftNL

    PHP:
    World world Bukkit.getWorld("world");//<--- Enter world here | you can modify it in your command.
    int x = (int) (r.nextInt(1000) * r.nextInt(3) - r.nextInt(500));
    int z = (int) (r.nextInt(1000) * r.nextInt(3) - r.nextInt(500));
    Block b world.getHighestBlockAt(xz);
    Location location = new Location(worldxb.getY(), z);
     
  9. Offline

    codename_B

    Gotta be careful with that PlayerDeathEvent, if you take too long to process the code it fires multiple times.
     
Thread Status:
Not open for further replies.

Share This Page