Skip to content

Conversation

@danqzq
Copy link
Contributor

@danqzq danqzq commented Jan 11, 2026

Context

Fixed a bug where unstackable items like doors would duplicate when picked up if the player already had one of the same type in their inventory.

Changes

When combining items into an existing slot in Inventory::addItem(), the code was incorrectly setting combinedItemAmount = C_MAX_INVENTORY_STACK_SIZE (64) instead of maxStackSize for items with leftover count. This caused unstackable items (maxStackSize=1) to be improperly stacked to 64, with the overflow creating duplicate items.

Demo (after fix)

mcpe

Closes #168

@BrentDaMage
Copy link
Collaborator

Most well-documented PR for this repo I have ever come across. Good job.

@BrentDaMage BrentDaMage merged commit 3884caa into ReMinecraftPE:master Jan 11, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dying With Iron Door in Survival Results in Thousands of Doors

2 participants