mojira.dev
MC-101063

Invalid item id in villager trading causes client, who tries to trade, to crash

Summon Villager with:

/summon Villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"stone",Count:1b},sell:{id:"-",Count:1b}}]}}

Afterwards attempt to trade with him and it will crash the client. Works on server or on single player

Linked issues

Attachments

Comments 11

I'm just going to say, you're doing a lot wrong with your command:

Base:"1f"....Base:"0f"

Base is not a string, nor a float, its a dubble, use

Base:1d....Base:0d

sell:{id:373,Count:1,Damage:8193

numeral id's are no longer supported (most likely the cause of your crash), and potions no longer use damage values.

Fix your command, then see if the issue still occures.

Yes, that did it. Thank you!

Resolve as Invalid?

Negative, since it causes the local client to crash its also possible that something could be injected into the client. At minimal, its a bug that can cause any client to crash when connected to a server where this code has been inserted into a command block, and could be done so maliciously. This should be able to be corrected by sanitizing the input variables passed from commands.

Using incorrect syntax, improper variables, and other un-conforming methods to induce a software crash, is typically the first step to finding exploits.

What you have here, is still a bug. Improper formatting or not.

Doesn't crash for me in 1.9.3 Pre-Release 1, assuming it's fixed.

1 more comments

Strongly relates to MC-18495

Caused by invalid item id

/summon Villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"stone",Count:1b},sell:{id:"-",Count:1b}}]}}

Hm, the command in the description didn't crash for me.

Caused by invalid item id

Invalid item id in villager trading.....

Was already known to be the issue...

I just wanted to confirm that as the provided command contained much more than only an invalid item id.

For me as soon as I put a stone block in the buy field the game crashes

Oh, putting the trade in, hehe, didn't do that, I just opened the trading menu, guess I missed a part of the description. XD

Attached your command to the description, as it's more clear, and less long.

Fixed for 16w32b (gives nothing)

supertechguy

(Unassigned)

Confirmed

Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 1

Minecraft 16w32b

Retrieved