From cfccd708309a20d3c957101b912c466ece50e46c Mon Sep 17 00:00:00 2001 From: Moxvallix Date: Fri, 31 Jul 2026 18:20:58 +0930 Subject: [PATCH] feat(waypoints): click event on the waypoint death message coords tp if opped --- .../meteorclient/utils/player/ChatUtils.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/utils/player/ChatUtils.java b/src/main/java/meteordevelopment/meteorclient/utils/player/ChatUtils.java index bb302793af8..4906a3a52bf 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/player/ChatUtils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/player/ChatUtils.java @@ -14,6 +14,7 @@ import meteordevelopment.meteorclient.utils.misc.text.MeteorClickEvent; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.*; +import net.minecraft.server.permissions.Permissions; import net.minecraft.util.Tuple; import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.Nullable; @@ -265,7 +266,17 @@ public static MutableComponent formatCoords(Vec3 pos) { String coordsString = String.format("(highlight)(underline)%.0f, %.0f, %.0f(default)", pos.x, pos.y, pos.z); MutableComponent coordsText = formatMsg(coordsString, ChatFormatting.GRAY); - if (BaritoneUtils.IS_AVAILABLE) { + if (mc.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER)) { + Style style = coordsText.getStyle().applyFormats(ChatFormatting.BOLD) + .withHoverEvent(new HoverEvent.ShowText( + Component.literal("Teleport to coordinates") + )) + .withClickEvent(new ClickEvent.SuggestCommand( + String.format("/tp @s %d %d %d", (int) pos.x, (int) pos.y, (int) pos.z) + )); + + coordsText.setStyle(style); + } else if (BaritoneUtils.IS_AVAILABLE) { Style style = coordsText.getStyle().applyFormats(ChatFormatting.BOLD) .withHoverEvent(new HoverEvent.ShowText( Component.literal("Set as Baritone goal")