diff --git a/src/main/java/land/chipmunk/chipmunkmod/config/Configuration.java b/src/main/java/land/chipmunk/chipmunkmod/config/Configuration.java index cbc0d34..6123ec0 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/config/Configuration.java +++ b/src/main/java/land/chipmunk/chipmunkmod/config/Configuration.java @@ -1,6 +1,9 @@ package land.chipmunk.chipmunkmod.config; import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.event.ClickEvent; +import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.format.NamedTextColor; import net.minecraft.util.math.BlockBox; import net.minecraft.util.math.BlockPos; import org.jetbrains.annotations.NotNull; @@ -77,9 +80,33 @@ public class Configuration { @ConfigSerializable public static class CustomChat { public @NotNull Component format = - Component.translatable("chat.type.text", - Component.selector("@s"), - Component.text("MESSAGE") - ); + // chipmunk's custom chat format + // §8[§7Chat§8] §aUSERNAME§8 › §7MESSAGE + // but with `Chat` replaced with `ChipmunkMod` + // and click events and hover events added + Component + .translatable("[%s] %s › %s", NamedTextColor.DARK_GRAY, + Component.text("ChipmunkMod", NamedTextColor.GREEN) + .hoverEvent( + HoverEvent.showText( + Component.text( + "Click here to open the ChipmunkMod source code (chayapak's fork)", + NamedTextColor.GREEN + ) + ) + ) + .clickEvent(ClickEvent.openUrl("https://code.chipmunk.land/ChomeNS/chipmunkmod")), + Component.selector("@s").color(NamedTextColor.GREEN), + Component.text("MESSAGE", NamedTextColor.GRAY) + .hoverEvent( + HoverEvent.showText( + Component.text( + "Click here to copy the message to your clipboard", + NamedTextColor.GREEN + ) + ) + ) + .clickEvent(ClickEvent.copyToClipboard("MESSAGE")) + ); } }