Class OpenToLAN

java.lang.Object
net.minestom.server.extras.lan.OpenToLAN

public class OpenToLAN extends Object
Utility class to manage opening the server to LAN. Note that this doesn't actually open your server to LAN if it isn't already visible to anyone on your local network. Instead it simply sends the packets needed to trick the Minecraft client into thinking that this is a single-player world that has been opened to LANfor it to be displayed on the bottom of the server list.
See Also:
  • Method Details

    • open

      public static boolean open()
      Opens the server to LAN with the default config.
      Returns:
      true if it was opened successfully, false otherwise
    • open

      public static boolean open(@NotNull @NotNull OpenToLANConfig config)
      Opens the server to LAN.
      Parameters:
      config - the configuration
      Returns:
      true if it was opened successfully, false otherwise
    • close

      public static boolean close()
      Closes the server to LAN.
      Returns:
      true if it was closed, false if it was already closed
    • isOpen

      public static boolean isOpen()
      Checks if the server is currently opened to LAN.
      Returns:
      true if it is, false otherwise