From 62c96fc77147b9b26c87fc45226832b282f4222e Mon Sep 17 00:00:00 2001 From: Emilxyz <12966472+Emilxyz@users.noreply.github.com> Date: Fri, 17 Apr 2026 21:28:34 +0200 Subject: [PATCH] feat: Make version clickable in velocity info command --- .../proxy/command/builtin/VelocityCommand.java | 11 +++++++---- .../velocitypowered/proxy/l10n/messages.properties | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java index 562efee42b..bebf1c1cb3 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java @@ -161,14 +161,17 @@ public int run(final CommandContext context) { .decoration(TextDecoration.BOLD, true) .color(VELOCITY_COLOR) .append(Component.text() - .content(version.getVersion()) - .decoration(TextDecoration.BOLD, false)) + .content(version.getVersion()) + .decoration(TextDecoration.BOLD, false)) + .hoverEvent(Component.translatable("velocity.command.version-offer-copy-version")) + .clickEvent(ClickEvent.copyToClipboard(version.getName() + " " + + version.getVersion())) .build(); final Component copyright = Component .translatable("velocity.command.version-copyright", Argument.string("vendor", version.getVendor()), - Argument.string("name", version.getName()), - Argument.component("year", Component.text(LocalDate.now().getYear()))); + Argument.string("name", version.getName()), + Argument.component("year", Component.text(LocalDate.now().getYear()))); source.sendMessage(velocity); source.sendMessage(copyright); diff --git a/proxy/src/main/resources/com/velocitypowered/proxy/l10n/messages.properties b/proxy/src/main/resources/com/velocitypowered/proxy/l10n/messages.properties index 744cb68b43..292dbe33b0 100644 --- a/proxy/src/main/resources/com/velocitypowered/proxy/l10n/messages.properties +++ b/proxy/src/main/resources/com/velocitypowered/proxy/l10n/messages.properties @@ -49,6 +49,7 @@ velocity.command.glist-view-all=To view all players on servers, use /glist all. velocity.command.reload-success=Velocity configuration successfully reloaded. velocity.command.reload-failure=Unable to reload your Velocity configuration. Check the console for more details. velocity.command.version-copyright=Copyright 2018- . is licensed under the terms of the GNU General Public License v3. +velocity.command.version-offer-copy-version=Click to copy version to clipboard velocity.command.no-plugins=There are no plugins currently installed. velocity.command.plugins-list=Plugins: velocity.command.plugin-tooltip-website=Website: