Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem on PlayerQuitEvent

Comments in 'Plugin Development' started by MyNameIsTriXz, Mar 8, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Why isnt the player fully unregistered when PlayerQuitEvent was triggered, as example when I do count($level->getPlayers()) on the level of the player who left, then the left player gets also counted, is it a bug? And is there any way to bypass it?
  2. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Um... count - 1?
    Vaivez66 likes this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It is not a bug. When PlayerQuitEvent is triggered, the player actually hasn't left the game yet.
    How to fix it: remember this fact, every time player quits, minus one from player count.
  4. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    I even do that, but thats not the main bug.

Share This Page

Advertisement