Skip to content

Updating BlockState for Container clears inventory #9784

@ZombieStriker

Description

@ZombieStriker

Expected behavior

After getting the Container and the inventory, and after adding an item to the inventory, using the "BlockState#update(true,false)" method should update the blockstate, while preserving the new items in the inventory.

Observed/Actual behavior

The inventory is cleared upon forcing an update

Steps/models to reproduce

Container container = .....
container.getInventory().addItem(.....)
container.update(true,false)

This will clear the inventory of the new item added by addItem

Plugin and Datapack List

The plugin used to test this

Paper version

This server is running Paper version git-Paper-196 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 773dd72)
You are running the latest version
Previous version: git-Paper-307 (MC: 1.19.2)

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolution: works as intendedWorking as it should / expected totype: bugSomething doesn't work as it was intended to.

    Type

    No fields configured for Bug.

    Projects

    Status

    Invalid

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions