Download ServerLinksSender — Minecraft Mods — MetaMods
ServerLinksSender

ServerLinksSender

Active

Downloads

0

Last update

11 months ago

Versions

1.21 — 1.21.3
Server
Fabric
Control
Technological
Utils

ServerLinksSender

Context

With the release of Minecraft 1.21, a new feature appeared: vanilla servers can send special links to clients, which are then displayed in the game pause menu under the "Server Links" section. In this section, links are presented as a list, and players can click on them.

Initially, Minecraft only allows sending links for reporting bugs on the server, but the system's potential is much broader! This is where this mod comes to the rescue.

What It Is

ServerLinksSender allows you to configure custom button labels and their corresponding links. You can create your own links and labels for purposes such as server websites, voting pages, Discord servers, and much more, and also periodically update them while the server is running.

Additionally, the mod supports Placeholder API and quicktext, providing simple and dynamic work with text components.

You can also use Predicate API to send certain links only when specific conditions are met. For example, you can send a link to admin documentation only to players with appropriate permissions, or send a link with event rules if the player is in a specific world!

Limitations

First of all, it's important to note that you won't be able to use click events or hover effects, as these elements are used in buttons, not in chat. Although not all possibilities have been fully tested, it can be confidently said that text decorations and colors work correctly.

Additionally, the server links screen in the vanilla version does NOT redraw when new links are sent. It only updates when the player opens it, and redrawing occurs only once. This means you cannot use highly dynamic placeholders like world time, as they are not updated as the player views them.

Commands

Command Permission Description
/reloadserverlinks [--force-update] serverlinks.main Reloads the configuration from the file and can additionally send the new list to all online players. This is especially useful if players receive links only once (details below), and you want to update the links without requiring them to re-login

Example Configuration

The mod creates a default configuration that can be used as a basis. Below is a similar configuration file with some explanations (marked with //):

{
// how many ticks should pass before the list is sent to all players again
// this will be needed if you use placeholders that change during the gaming session. Setting the value to 20 means sending occurs approximately once per second. Values less than 20 are not recommended.
// Setting the value to -1 disables periodic updates, meaning players will receive the list only when they log in (or when --force-update is used)
  "refresh_interval": -1,
// list of links sent to all users without any conditions
  "global_server_links": {
    "<red><bold>My cool link!": "https://google.com"
  },
// additional sets of links that can be sent in addition to those above if the player meets the requirements (e.g., has a certain permission or is in a certain world)
  "additional_links": [
    {
      "links": {
        "<rb>My additional link!": "https://google.com"
      },
      // for more information on how to use this, see here https://github.com/Patbox/PredicateAPI/blob/1.21/BUILTIN.md
      "requirement": {
        "type": "permission",
        "permission": "example.permission",
        "operator": 2
      }
    }
  ]
}
Project members
BlackSpirit

BlackSpirit

Developer

BlackSpirit

BlackSpirit

Developer

Created: 29 Jun 2024

ID: 23960