Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

[BUG] AdvancedChatBox: Game crashes when entering JSON text into a command #14

Open
floral-qua-floral opened this issue Dec 28, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@floral-qua-floral
Copy link

floral-qua-floral commented Dec 28, 2021

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

  1. Open chat
  2. Type /tellraw @s {"text":""
  3. Add the closing curly bracket. The game will crash
  4. Re-enter game and open chat
  5. Type {"text":"JSON"}
  6. 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
@floral-qua-floral floral-qua-floral added the bug Something isn't working label Dec 28, 2021
@John-Paul-R
Copy link

Can also reliably reproduce this (e.g. /tellraw @p "testing" -> crash).

Originally reported to me through this issue John-Paul-R/Essential-Commands#91

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants