PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
10.02k stars 2.32k forks source link

Enderchest inventory doesn't have a holder #10862

Open ghost opened 5 months ago

ghost commented 5 months ago

Expected behavior

@EventHandler
    public void onEchestOpen(InventoryOpenEvent event) {
        if (event.getInventory().getType() != InventoryType.ENDER_CHEST) {
            return;
        }
        Bukkit.broadcastMessage("ec: " + event.getInventory().getHolder());

holder should return the enderchest blockstate

Observed/Actual behavior

Opening an enderchest:

ec: null

Has no holder

Steps/models to reproduce

Open enderchest, use listener

Plugin and Datapack List

N/A

Paper version

This server is running Paper version git-Paper-"f4c7d37" (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: f4c7d37) Probably isn't fixed in 1.20.6 judging by the commits

Other

No response

Malfrador commented 5 months ago

holder should return the enderchest blockstate

I would argue that the holder of the ender chest is the player, not the block. It is saved in player data and attached to the player, the block is just the "button" to open it - though you can also open it via the API without involving any block.