Class ServerInfo

java.lang.Object
net.minecraft.client.network.ServerInfo

@Environment(CLIENT)
public class ServerInfo
extends Object
The information of a server entry in the list of servers available in the multiplayer screen from the menu. The list of these servers is stored in the servers.dat file within the client game directory.
  • Field Details

    • name

      public String name
    • address

      public String address
    • playerCountLabel

      public Text playerCountLabel
    • label

      public Text label
    • ping

      public long ping
    • protocolVersion

      public int protocolVersion
    • version

      public Text version
    • online

      public boolean online
    • playerListSummary

      public List<Text> playerListSummary
    • resourcePackPolicy

      private ServerInfo.ResourcePackState resourcePackPolicy
    • icon

      @Nullable private String icon
    • local

      private boolean local
  • Constructor Details

    • ServerInfo

      public ServerInfo​(String name, String address, boolean local)
  • Method Details

    • toNbt

      public NbtCompound toNbt()
    • getResourcePackPolicy

      public ServerInfo.ResourcePackState getResourcePackPolicy()
      Returns the policy on resource packs sent by this server.
    • setResourcePackPolicy

      public void setResourcePackPolicy​(ServerInfo.ResourcePackState policy)
      Sets the resource pack policy on this server.

      This is called when a user has responded to the prompt on whether to accept server resource packs from this server in the future.

    • fromNbt

      public static ServerInfo fromNbt​(NbtCompound root)
    • getIcon

      @Nullable public String getIcon()
    • setIcon

      public void setIcon​(@Nullable String icon)
    • isLocal

      public boolean isLocal()
    • copyFrom

      public void copyFrom​(ServerInfo serverInfo)