Mojira Archive
MC-271001

Items in a container can be given a count above 99 (to max integer), and can crash the world

Using the following give command, item stacks can be given extremely high counts up to the java max integer.

/give @s barrel[container=[{slot:0,item:{id:wooden_sword,count:2147483647}}]]

Placing and then breaking the barrel will cause the stack to split into smaller stacks, spawn at least a few hundred million item entities, and crash the world. The split stacks seem to have random counts around 10 to 30, so it's slightly less than 2 billion entities spawned at once.

Using commands to get an item with max_stack_size above 99 will detect and remove the invalid component, and setting the item count to below 1 will set it back to 1. Expected behavior would be for item count to be limited to the max_stack_size (or at least a hard coded max of 99).

Fixed

42Richtofen42

[Mojang] etanaratsastaja

2024-04-21, 08:48 AM

2024-05-06, 03:47 PM

2024-05-06, 03:47 PM

4

6

Confirmed

Very Important

Platform

Crash

1.20.5 Pre-Release 1, 1.20.5 Release Candidate 2, 1.20.6

24w19a