Skip to content

Even if you update the information of the hopper's import source Inventory using InventoryMoveItemEvent, it is not reflected in the game. #10434

@snowpegeon

Description

@snowpegeon

Expected behavior

The number of items set with Inventory.setItem will be reflected in the game for the inventory that can be obtained with InventoryMoveItemEvent.getSource().

Observed/Actual behavior

Even if the internal variables are treated differently, when you check the game, the changed number is not reflected, and it only performs the normal operation of transporting items one by one to the hopper.

Steps/models to reproduce

https://github.com/eventhandler
public void onItemMove(InventoryMoveItemEvent event) {
ItemStack item = event.getItem().clone();
Inventory inv = event.getSource();

item.setAmount(item.getAmount() + 1);
inv.setItem(0, item);
}

Plugin and Datapack List

[21:02:13 INFO]: Server Plugins (2):
[21:02:13 INFO]: Bukkit Plugins:
[21:02:13 INFO]: - Logger, StorageSign

Paper version

[21:02:30 INFO]: Checking version, please wait...
[21:02:31 INFO]: This server is running Paper version git-Paper-485 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 862299b)
You are running the latest version
Previous version: git-Paper-454 (MC: 1.20.4)

Other

Logger and StorageSign are both plugins that I am developing.
This text was written using translation software.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething doesn't work as it was intended to.

    Type

    Projects

    Status

    Invalid

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions