mojira.dev
MC-96526

Crash caused by StackOverflowError when trading too many items at once

This report is based on MC-34943

The bug

When you have a villager trading an item for an item with the Count of 0 and you Shift-click on the trade when you have a empty inventory, Minecraft crashes.

How to reproduce

  1. Use the following command

    /summon Villager ~ ~1 ~ {Health:0.1f,Offers:{Recipes:[{buy:{id:"stone",Count:0b},sell:{id:"dirt",Count:1b},maxUses:2147483647,uses:0}]}}
  2. Empty your inventory

  3. Give yourself one stone block

  4. Place the stone block in the trading window and Shift-click the offered item (dirt)

Attachments

Comments 10

Confirmed for 16w05b

Confirmed for 1.9

Still in 1.9.1-pre3

Probably "Invalid"

Normal villagers can only trade 64 items at once and there this bug should not occur

Fixed for 1.9.3-pre2! Stops at full inventory without 32 items.
Edit: still in -pre1

The exception is still printed to the Game Output but I guess that is not such a big problem

@unknown perhaps a different report will do.

I don't think using items with count of 0 results in a valid report

Nevertheless, the game should not print an exception, and this report (which also has a count tag of 0) was also a valid report.

marcono1234

(Unassigned)

Community Consensus

StackOverflowError, trade, trading

Minecraft 16w05a, Minecraft 16w05b, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.2, Minecraft 16w15b, Minecraft 1.9.3 Pre-Release 1

Minecraft 1.9.3 Pre-Release 2

Retrieved