diff --git a/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java b/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java index e903c37..58f9488 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java +++ b/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java @@ -109,7 +109,8 @@ public class ChatPlugin extends SessionAdapter { public void tellraw (Component message, String targets) { final int maxLength = client.core().maxCommandLength(); String command = "minecraft:tellraw " + targets + " " + GsonComponentSerializer.gson().serialize(message); - if (command.length() > maxLength) command = "minecraft:w " + targets + " " + ComponentUtilities.stringify(message); + if (command.length() > maxLength) command = ("minecraft:w " + targets + " " + ComponentUtilities.stringify(message)); + if (command.length() > maxLength) command = command.substring(0, maxLength); client.core().run(command); } public void tellraw (Component message) { tellraw(message, "@a"); }