1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Async Pre Login Disallow in Skript

Discussion in 'Skript' started by igstwd, Oct 1, 2022.

Thread Status:
Not open for further replies.
  1. igstwd

    igstwd Member

    Joined:
    Jan 10, 2020
    Messages:
    2
    Likes Received:
    0
    Hello. I'm looking for a way to use an AsyncPlayerPreLoginEvent in a skript.

    Code (Text):
    1. @EventHandler
    2. public void onPreLogin(AsyncPlayerPreLoginEvent event) {
    3.  ///
    4.     event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "You cant join");
    5. }
    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
     
  2. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    116
    Likes Received:
    4
    Yo mean that?

    Code (Text):
    1.  
    2. on connecting:
    3.   kick player due to "You cant join since youre too ඞ"
    4.  
     
  3. igstwd

    igstwd Member

    Joined:
    Jan 10, 2020
    Messages:
    2
    Likes Received:
    0
    As i said, I am not looking for a solution such as kick a player when he joins
     
  4. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    116
    Likes Received:
    4
    Yes, but the on connecting event is when the player tries to connect not joined. So this should be your "Pre Login Event"
     
  5. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    with Skript-reflect:

    Code (Text):
    1. import:
    2.   org.bukkit.event.player.AsyncPlayerPreLoginEvent
    3.  
    4. on AsyncPlayerPreLoginEvent:
    5.   event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "You cant join")
     
Thread Status:
Not open for further replies.

Share This Page

Loading...