1.14.4 Full async tasks on async join?

Discussion in 'Spigot Plugin Development' started by relampagorojo93, Feb 7, 2020.

  1. Hello everyone,
    I'm trying to make some plugins and I'm trying to make it the most cross-server possible, so all the data can be the same or can be gotten by every server. I'm trying to leave the required and most prescindible tasks as sync cause the system, but the other ones I use async tasks. One of the requirements I need is to make a check before a player joins, so I need to use the AsyncPlayerPreLoginEvent to make that, but I have some questions. Spigot works executing asynchronously the events from other plugins? I mean, if Spigot is sending this event, is calling every method on your code, but if it's an Async event, is going to call your methods asynchronously too? I have some plugins using the AsyncPlayerPreLoginEvent and executing a function from a lib to make a query and get some data, but server's getting frozen, so I don't know if it's cause I'm missunderstanding the real function of this event or cause something else.
  2. SteelPhoenix


    The event is passed to all event listeners from an async thread (not the main server thread) and it keeps executing code on that thread
  3. Perfect, thank you for the answer, just I wanted to make sure everything was running in async