send separate chat messages for each line in reply

This commit is contained in:
Xujiayao 2025-12-27 21:39:55 +08:00
parent ce23c5e006
commit 26da430bb9

View file

@ -56,7 +56,10 @@ public class MinecraftCommands {
@Override
public void reply(String message) {
// TODO Ephemeral if false, visible to all admin if true
source.sendSuccess(() -> Component.literal(message), false);
// For each line in the message, send a separate chat message
for (String line : message.split("\n")) {
source.sendSuccess(() -> Component.literal(line), false);
}
}
}
}