• Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

igstwd

Member
Jan 10, 2020
2
0
1
25
Hello. I'm looking for a way to use an AsyncPlayerPreLoginEvent in a skript.

Code:
@EventHandler
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
 ///
    event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "You cant join");
}

I am not looking for a solution such as kick a player when he joins after 1ms. It is not the same thing.

I've seen skjade addon which offers such an event but doesn't offer disallow like in the code above.

Has anyone seen a solution to this problem? Thanks in advance
 
Yo mean that?

Code:
on connecting:
  kick player due to "You cant join since youre too ඞ"
 
Yes, but the on connecting event is when the player tries to connect not joined. So this should be your "Pre Login Event"
 
Hello. I'm looking for a way to use an AsyncPlayerPreLoginEvent in a skript.

Code:
@EventHandler
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
 ///
    event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "You cant join");
}

I am not looking for a solution such as kick a player when he joins after 1ms. It is not the same thing.

I've seen skjade addon which offers such an event but doesn't offer disallow like in the code above.

Has anyone seen a solution to this problem? Thanks in advance

with Skript-reflect:

Code:
import:
  org.bukkit.event.player.AsyncPlayerPreLoginEvent

on AsyncPlayerPreLoginEvent:
  event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "You cant join")
 
Status
Not open for further replies.