AdvancedChatCore
AdvancedChatCore copied to clipboard
[BUG] AdvancedChatBox: Game crashes when entering JSON text into a command
Describe the bug When I type in some JSON text in a command that accepts it (such as /tellraw or /title), the game will crash as soon as it becomes valid. It doesn't crash while the JSON is invalid, such as when it's missing a quotation mark or curly bracket. It also doesn't crash if you just start typing JSON somewhere it doesn't belong, such as a chat message or a command that doesn't accept JSON (such as /tp). When you press the last key that would make the JSON valid, the game will crash before the character can appear.
Minecraft Info Minecraft information:
- Minecraft 1.18.1
- Fabric Loader 0.12.12-1.18.1
- AdvancedChatCore 1.3.2
- AdvancedChatBox 1.1.1
- Fabric API 0.45.0
- MaLiLib 1.18.0-0.10.0-dev.26 No other mods are installed. Of note is that removing AdvancedChatBox makes the issue no longer occur.
To Reproduce
- Open chat
- Type
/tellraw @s {"text":""
- Add the closing curly bracket. The game will crash
- Re-enter game and open chat
- Type
{"text":"JSON"}
- Move the text cursor back to the start of the message and type
/title @s title
. The game will crash
Expected behavior I'd assume some sort of JSON-specific syntax highlighting is supposed to show up?
Additional context Crash report: crash-2021-12-28_14.35.16-client.txt Launcher warning:
The game crashed whilst rendering screen
Error: java.lang.StringIndexOutOfBoundsException: begin 12, end 24, length 23
Exit Code: -1