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.

Solved Get player address

Discussion in 'Skript' started by Skayar, Apr 22, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. Skayar

    Skayar Member

    Joined:
    Apr 21, 2019
    Messages:
    4
    Likes Received:
    0
    Hi,

    Is there a way to get the address/domain that the Player uses to connect to the Server / Bungeecord Network?

    Thx for you help,
    Skayar

     
  2. Best Answer:
    Post #4 by novastosha, Apr 22, 2020
  3. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    I use this my self for my server when i got sponsored

    It is only possible in java


    Code (Java):
    1. public class Plugin extends JavaPlugin implements Listener
    2. {
    3.     @Override
    4.     public void onEnable()
    5.     {
    6.        
    7.         getServer().getPluginManager().registerEvents(this, this);
    8.     }
    9.  
    10.     @Override
    11.     public void onDisable()
    12.     {
    13.      
    14.         PlayerJoinEvent.getHandlerList().unregister((Listener) this);
    15.     }
    16.  
    17.     @EventHandler
    18.     public void onLogin(PlayerLoginEvent e)
    19.     {  
    20.  
    21.         String msg = e.getPlayer().getName() + " has joined to " + e.getHostname();
    22.         Bukkit.getLogger().log(Level.INFO, msg);
    23.     }
    24. }
     
  4. Skayar

    Skayar Member

    Joined:
    Apr 21, 2019
    Messages:
    4
    Likes Received:
    0
    Okay, thx.

    But is it maybe possible with Skript Mirror?
     
  5. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    maybe
    --- Double Post Merged, Apr 22, 2020, Original Post Date: Apr 22, 2020 ---
    Code (Skript):
    1. import:
    2.     org.bukkit.event.player.PlayerLoginEvent
    3. on "PlayerLoginEvent":
    4.     set {_name} to event.getHostname()
    5.     send "%{_name}%" to event.getPlayer()
    6.  
    Not tested, if does not work try to remove "to event.getPlayer()"
     
  6. Skayar

    Skayar Member

    Joined:
    Apr 21, 2019
    Messages:
    4
    Likes Received:
    0
    The Skript Mirror Code works, thanks a lot
     
    • Friendly Friendly x 1
  7. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    Your welcome
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...