mojira.dev
MC-137706

Selecting obfuscated text in book crashes the game

The bug

When you edit the book and attempt to select part of text that is obfuscated, the game crashes.

Crash report

18w43b: [^crash-2018-10-24_22.27.19-client.txt]

Description: Rendering screen

java.lang.StringIndexOutOfBoundsException: String index out of range: 35
	at java.lang.String.substring(String.java:1951)
	at cor.m(SourceFile:670)
	at cor.a(SourceFile:614)
	at cxp.a(SourceFile:795)
	at cjj.c(SourceFile:817)
	at cjj.a(SourceFile:380)
	at net.minecraft.client.main.Main.main(SourceFile:144)

How to reproduce

  1. Open book and quill

  2. Paste § to the book and add the letter 'k'

  3. Continue writing, the text should consist just from randomly changing characters

  4. Try to select obfuscated text

Linked issues

Attachments

Comments

marcono1234

When I try to paste the § character in the book it appears to be ignored. Is there something special to consider?

[Mod] Neko

Can confirm when pasting §, then typing 'k', then adding text and selecting it.

Rikard Herlitz

You are not supposed to be able to add the § symbol and styling yet at all, so that's the bug. It will be prevented in the upcoming snapshot until we implement proper component-based styling.

fcelon

(Unassigned)

Confirmed

formatting-codes, writable_book

Minecraft 18w43b

Minecraft 18w43c

Retrieved