One timer for each player

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

  1. Offline


    code :

    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


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


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


Share This Page