Solved Minimessage click action behavior

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

__bennie_

New member
Aug 11, 2022
1
0
1
30
Netherlands
Hi all, I'm currently trying to give a link with formatted search parameters to a player that joins the server. To give the player the link I want them to click on a piece of text in the chat, and for this I'm using the minimessage click function. This formatting works fine but for some reason it will cut-off the link somewhere arbitrarily, which is really annoying behavior and I don't understand why. Can someone point out to me what I'm missing?

Java:
@EventHandler
public void onDisplayLink(PlayerLoginEvent event) {
    Player player = event.getPlayer();

String verificationCode = this.plugin.getWebSocketManager().generateVerificationCode(6);
    String playerName = player.getName();

String urlEncodedParameters = this.plugin.getWebSocketManager().encodeBase64(String.format("name=%s&code=%s", playerName, verificationCode));
String connectionUrl = this.configManager.getWebServerURL() + "?data=" + urlEncodedParameters;

//Send player information
    this.plugin.getServer().getScheduler().scheduleSyncDelayedTask(this.plugin, () -> {

//Debug message to check if the connection URL is correct
        player.sendMessage(connectionUrl);

String miniMessageFormat = "<gray>Open the <click:open_url:" + connectionUrl + "><green>interactive environment</click><gray> to immerse with the game.<newline>" +
"<gray>Click on <click:copy_to_clipboard:" + verificationCode + "><green>verification code <gray>to copy the code to your clipboard.";

MessageUtil.sendMessage(player, miniMessageFormat, true);
}, 20L);

//Save to session data
    this.plugin.getWebSocketManager().createUnconnectedSessionData(playerName, verificationCode);
}

chat.png

click.png

As you can see the URL in the chat is showing no issue, but when I want to add it to the click action it cuts off just before the port definition.
 
Version Output
This server is running Paper version 1.21-118-master@438863c (2024-07-29T15:17:04Z) (Implementing API version 1.21-R0.1-SNAPSHOT)