Files
AdvancedServerList/docs/profiles/index.md
T
2024-02-16 11:13:50 +01:00

10 KiB

icon
icon
octicons/note-24

Profiles

AdvancedServerList allows you to create multiple so called Server List Profiles.
A Server List Profile is a YAML file located in the plugin's profiles folder. Each Server List Profile allows you to modify one or multiple aspects of your server's display in a Multiplayer Server list.

Additionally can Conditions and a Priority be set to set when a specific profile should be displayed to a player.

Required Options

For a Server List Profile to be valid, will it require the following options to be set:

Priority

The Priority option allows you to define what Server List Profile should be chosen first.
The plugin will go highest value to lowest value and will select the first Profile that has a condition returning true.

Should AdvancedServerList not find any profile with a positive condition will it not modify the server list for the players.

/// note It is important to note that should no condition option be set will it default to true, meaning that a profile with priority 1 and no condition will be chosen over a profile with priority 0 and a condition, even if said condition also returns true. ///

Condition

The condition option allows you to define specific requirements that need to be met to display the profile in question.
Not setting this option, or setting it to an empty String (condition: ''), will result in true being returned.

The condition option can hold one or multiple expressions. The Expression system is explained on the Expressions page.

Profiles

The profile option allows you to define a list of all other options, with the exception of priority, condition or itself.

When multiple entries are defined will AdvancedServerList randomly select one.
Should an option exist in the file itself (i.e. motd) but not in the selected profiles entry will it be used. This allows you to randomize only one aspect of a Server List Profile while keeping all other options the same.

/// details | Example type: example

priority: 0

profiles:
  - motd: # You can also use ['<rainbow>Line1</rainbow>','<rainbow:!>Line 2</rainbow>']
      - '<rainbow>Line 1</rainbow>'
      - '<rainbow:!>Line 2</rainbow>'
    playerCount:
      text: '<green><bold>Awesome!'
  - playerCount:
      text: '<yellow><bold>Also Awesome!'

# This MOTD is used when the second profiles entry is selected.
motd:
  - '<rainbow:2>Line A</rainbow>'
  - '<rainbow:!2>Line B</rainbow>'

profiles-example-1{ loading="lazy" }
profiles-example-2{ loading="lazy" }

///

Motd

The motd option allows you to alter the "Message of the day" that is being displayed on a server in the multiplayer screen.
Please see the Formatting for all supported formatting options.

Multiple, randomly selected, MOTDs can be displayed by using the profiles option.

/// details | Example type: example

priority: 0

motd:
  - '<rainbow:2>Rainbow Gradient</rainbow>'
  - '<rainbow:!2>|||||||||||||||||||||||||||||||||||||</rainbow>'

motd-example{ loading="lazy" }

///

Favicon

The favicon option can be used to define an image to display in the server list.

The Value can be one of three possible options, each being checked for in order:

  • A URL pointing to an image file. The URL needs to start with https:// to work.
  • A PNG filename, including .png file extension, matching a PNG file in the favicons folder.
  • A player name or UUID, or a placeholder that resolves into one.

Note that for the name/UUID, the site https://mc-heads.net is being used.
Use the URL option with the ${player uuid} placeholder if you want to use another service.

/// details | Example type: example

priority: 0

# Hides the MOTD for demonstration purposes
motd:
  - '<grey>'
  - '<grey>'

# Placeholder resolves to UUID of Andre_601
favicon: '${player uuid}'

favicon-example{ loading="lazy" }

///

PlayerCount

The playerCount option contains various other options that are used to modify the player count (The text next to the ping icon that shows the online and max players of a server).

HidePlayers

The playerCount -> hidePlayers option takes a boolean (true or false) to set whether the player count should be hidden or not.

When set to true will the player count be replaced with ???.
In addition are the playerCount -> text and playerCount -> hover options ignored.

If you want to not show any text at all, set this option to false (or remove it) and instead use the playerCount -> text option.

/// details | Example type: example

priority: 0

# Hides the MOTD for demonstration purposes
motd:
  - '<grey>'
  - '<grey>'

playerCount:
  hidePlayers: true

hideplayers-example{ loading="lazy" }

///

Hover

The playerCount -> hover option allows you to define lines of text to show when a player hovers over the player count with their cursor.

Note that this option only accepts basic colors such as <blue> or <grey> and that HEX colors are not supported.

/// details | Example type: example

priority: 0

# Hides the MOTD for demonstration purposes
motd:
  - '<grey>'
  - '<grey>'

playerCount:
  hover:
    - '<grey>Line 1'
    - '<aqua>Line 2'
    - '<gold>Line 3'

hover-example{ loading="lazy" }

///

Text

The playerCount -> text option allows you to define a custom text to display instead of the usual <online>/<max>.

Please take note of the following caveats:

  • The plugin won't automatically add the <online>/<max> back to the text you set. Instead you'll have to use ${server playersOnline}/${server playersMax} to recreate this.
  • The override is done by using the "outdated server" text displayed when a client pings a server that is not compatible. This means that the ping icon will appear crossed out and your server will be seen as "outdated" by the client (When hovering over the ping icon). This can't be avoided nor fixed by the plugin.

If you want to not show any text, just use a single color (i.e. text: '<grey>') to do so.

This option only supports basic colors and no HEX colors.

/// details | Example type: example

priority: 0

# Hides the MOTD for demonstration purposes
motd:
  - '<grey>'
  - '<grey>'

playerCount:
  text: '<yellow><bold>Cool text!'

text-example{ loading="lazy" }

///

ExtraPlayers

The playerCount -> extraPlayers option contains settings for the "extra players" feature, which adds X to the current online player count and sets it as the server's max player count.

Enabled

Enables the extraPlayers feature.
Use the playerCount -> extraPlayers -> amount option to set how much to add to the max players count.

Amount

The playerCount -> extraPlayers -> amount option defines how much should be added to the current online player count to then use as max player count.

Example: Setting this option to 1 while currently 10 players are online will result in 10/11 being displayed on the player count (Assuming it is not being overriden by the playerCount -> text option).

/// details | Example type: example

priority: 0

# Hides the MOTD for demonstration purposes
motd:
  - '<grey>'
  - '<grey>'

playerCount:
  extraPlayers:
    enabled: true
    amount: 1

extraplayers-example{ loading="lazy" }

///

MaxPlayers

The playerCount -> maxPlayers option is similar in nature to the playerCount -> extraPlayers option, with the difference that the number set is being used as the max player count, instead of adding it together with the online player count first.

Enabled

Enables the maxPlayers feature.
Use the playerCount -> maxPlayers -> amount option to set the max player count itself.

Amount

The playerCount -> maxPlayers -> amount option defines the number to use as the server's max players count.
Unlike the playerCount -> extraPlayers -> amount option does this one not first add the current online player count to the number to then set.

/// details | Example type: example

priority: 0

# Hides the MOTD for demonstration purposes
motd:
  - '<grey>'
  - '<grey>'

playerCount:
  maxPlayers:
    enabled: true
    amount: -1

maxplayers-example{ loading="lazy" }

///