mojira.dev
MC-269933

limit_count item modifier can create overstacked items

Summary
limit_count item modifier can create item stacks containing more items than their max_stack_size.

Steps to Reproduce

  1. Give yourself a stick

  2. Run /item modify entity @s hotbar.0 {function:"limit_count",limit:{min:99}}

Expected Result
The command either fails or sets stack count to 64.

Actual Result
The game sets the stack count to 99, despite the max_stack_size being 64.

Attachments

Comments 2

I've removed the part about the crash, as it's tracked in MC-269680.

This bug does not involve setting max_stack_size.

apple502j

gegy

Confirmed

Platform

Important

Commands

24w12a, 24w13a

1.20.5 Pre-Release 1

Retrieved