Skip to content

Placeholders

Michiel edited this page Dec 7, 2017 · 1 revision

AnimatedMenu mainly uses AnimationLib for its placeholders. It doesn't work on its own though. AnimationLib needs either PlaceholderAPI or MVdWPlaceholderAPI. You can then use %placeholder% in order to add a placeholder to text. AnimatedMenu itself adds a few placeholders:

Server status placeholders

The following placeholders can contain an <id>. In order to use these, inside of the plugin's config.yml you will need to put:

Connections:
  <id>:
    IP: '<ip>:<port>'
    # ... Further information can be found at each placeholder

<id> can be anything, just make sure to use the same value inside of the placeholder

%animatedmenu_motd_<id>% or %animatedmenu_motd_<ip>:<port>%

Obtains the motd of a server.

%animatedmenu_motd1_<id>% or %animatedmenu_motd1_<ip>:<port>%

Obtains the first line of the motd of a server.

%animatedmenu_motd2_<id>% or %animatedmenu_motd2_<ip>:<port>%

Obtains the second line of the motd of a server. If the motd only has 1 line, it returns an empty text.

%animatedmenu_onlineplayers_<id>% or %animatedmenu_onlineplayers_<ip>:<port>%

Obtains the online player count of a server.

%animatedmenu_maxplayers_<id>% or %animatedmenu_maxplayers_<ip>:<port>%

Obtains the max player count of a server.

%animatedmenu_status_<id>%

Obtains the status of a server. In the config, you would have to put two values, "Online" and "Offline":

Connections:
  example:
    IP: <ip>:<port>
    Online: '&aOnline'
    Offline: '&cOffline'
# Then you could use %animatedmenu_status_example%

%animatedmenu_motdcheck_<id>%

Maps specific MOTD texts to values. In the config, the keys would be the motd and the values the result.

Connections:
  example:
    IP: <ip>:<port>
    # In game? Red wool
    '&cIn Game': 'wool:1:14'
    # Waiting? Green wool!
    '&aWaiting': 'wool:1:5'
    # The server has a different MOTD
    Default: 'wool:1:14'
    # The server is offline
    Offline: 'wool:1:14'

# Then in an item you could use:
Material: '%animatedmenu_motdcheck_example%'

Miscellaneous

%animatedmenu_worldplayers_<world>%

Obtain the player count of a world.

%animatedmenu_shownplayers_<world>%

Obtain the player count of a world, excluding those who are vanished through Essentials.