Links & Tokens

In several places in Nucleus, there is the option for links and chat placeholders (what we usually call tokens) to be used. The most obvious places that they can be used is in the motd.txt and various info files, but other modules accept them, including broadcasts.

Modules will include a link to this page where the funtionallity is supported.

Links can be included in various text locations using limited markdown syntax.

  • http://nucleuspowered.org - creates a link automatically
  • [Hello](http://nucleuspowered.org) - creates a link titled Hello to http://nucleuspowered.org
  • [Rules](/rules) - creates a link titled Rules that will run /rules when clicked.
  • [Blah](/msg player - Create a link that sends the message “player” to the player who is clicking the link entitled Blah.

Tokens/Variables

The following tokens can be used in both the motd and info files, and will be replaced at runtime.

  • {{currentworld}} - The current world of the player, if a player is accessing this.
  • {{displayname}} - The display name, or nickname, of the player.
  • {{ipaddress}} - The IP address of the user.
  • {{maxplayers}} - The maximum number of players your server can support.
  • {{name}} - The in-game name of the player.
  • {{onlineplayers}} - The number of players online on your server.
  • {{player}} - The in-game name of the player.
  • {{playerdisplayname}} - The in-game name of the player.
  • {{prefix}} - The player’s prefix, as defined by the “prefix” option in your permissions plugin.
  • {{suffix}} - The player’s suffix, as defined by the “suffix” option in your permissions plugin.
  • {{time}} - The current time in the world of the player, if a player is accessing this.
  • {{uniquevisitor}} - The estimated unique visitor count for the server.

Token Modifiers

Tokens support modifiers that control whether a space should be appended or prepended to the token output if the token exists.

The modifiers are:

  • p to prepend a space
  • s to append a space

To add a modifier to the end of a token, simply add “:[modifier]” at the end of the token (before }}). So, if you want your token (say, name) to have a space after it if it exists, the token would be {{name:s}}. Similarly, if you wanted a space before and after, specify {{name:sp}}.