One timer for each player

Discussion in 'Plugin Development' started by RFUDEO9EH, Mar 23, 2020.

  1. Offline

    RFUDEO9EH

    code : https://pastebin.com/QEmMs5z1

    this work correctly but the only problem is when 2 players do the event in the same time, the countdown and timer lag. So I want to know how to fix that, I think I need to create a timer for each player but I don't know how to do that. Can you help me pls ???
     
  2. Offline

    bowlerguy66

    @RFUDEO9EH You can create a map that will store a player's UUID and an Integer value:
    Code:
    Map<UUID, Integer> timers = new HashMap<UUID, Integer>();
    Then you'll be able to access each player's time like this:
    Code:
    int time = timers.get(uuid);
     
  3. Offline

    RFUDEO9EH

    Can you give me an example or explain me more, I don't know how to do that.
     
  4. Offline

    Symphonic

Share This Page