mojira.dev
MC-122317

Game crashes when a colon is entered after a slash or another colon in commands

The bug

When a colon is entered after a slash or another colon, the game will crash.

How to reproduce

Typing out the following commands will cause the game to crash:

/give @s minecraft::
/function example/:

Crash report

17w47b\: [^crash-2017-11-23_21.20.48-client.txt]

Description: charTyped event handler

java.lang.IllegalArgumentException: Non [a-z0-9/._-] character in path of location: minecraft::
	at mp.<init>(SourceFile:31)
	at mp.<init>(SourceFile:36)
	at mp.a(SourceFile:121)
	at cg.d(SourceFile:156)
	at cg.a(SourceFile:69)
	at cf.a(SourceFile:21)
	at cf.parse(SourceFile:14)
	at com.mojang.brigadier.tree.ArgumentCommandNode.parse(ArgumentCommandNode.java:55)
	at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:169)
	at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:191)
	at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:191)
	at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:143)
	at bpd.h(SourceFile:161)
	at bpd.a(SourceFile:97)
	at bpd$$Lambda$587/1093383199.accept(Unknown Source)
	at bnm.a(SourceFile:145)
	at bnm.b(SourceFile:140)
	at bnm.charTyped(SourceFile:383)
	at boi.charTyped(SourceFile:40)
	at bme.a(SourceFile:360)
	at bme$$Lambda$593/430092836.run(Unknown Source)
	at bqb.a(SourceFile:428)
	at bme.a(SourceFile:360)
	at bme$$Lambda$111/1323828508.invoke(Unknown Source)
	at org.lwjgl.glfw.GLFWCharModsCallbackI.callback(GLFWCharModsCallbackI.java:23)
	at org.lwjgl.system.JNI.invokeV(Native Method)
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:2520)
	at bmr.a(SourceFile:282)
	at bmh.b(SourceFile:843)
	at bmh.a(SourceFile:376)
	at net.minecraft.client.main.Main.main(SourceFile:134)

Linked issues

Attachments

Comments 3

Adding a colon ( : ) after a non-valid character seems to not crash the game.

> "minecraft:acacia_bark:" = crash
> "minecraft:acacia_bark?:" = no crash

Error given when adding the "?:"

Couldn't execute command for Winter_Snake: give Winter_Snake minecraft:acacia_boat?:
com.mojang.brigadier.exceptions.CommandSyntaxException: Expected whitespace to end one argument, but found trailing data at position 39: ...cacia_boat<--[HERE]

vs error given with ":"

Caused by: java.lang.IllegalArgumentException: Non [a-z0-9/._-] character in path of location: minecraft:acacia_boat:

Asked to test by Tryashstar: "aca?cia::"

Couldn't execute command for Winter_Snake: give Winter_Snake minecraft:aca?cia::
com.mojang.brigadier.exceptions.CommandSyntaxException: Unknown item 'minecraft:aca' at position 18: ...ter_Snake <--[HERE]

This error seems to stop caring after an invalid character is found and ignores the trailing colons, but my guess would be that the colon causes a crash because it's a special case regarding namespaces.

"/give MiniDigger minecraft:red:" crashes with "Caused by: g: Non [a-z0-9/._-] character in path of location: minecraft:red:"

The screen darkens out before crashing, this is possibly because the game attempts to display a server disconnection screen with a message pointer in RAM...

Lukas Junior

Nathan Adams

Confirmed

Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w49a, Minecraft 17w49b

Minecraft 17w50a

Retrieved