[SPIGOT-6360] player.openInventory causes invalid state Created: 12/Feb/21  Updated: 17/Apr/21

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Philipp B Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 1.16.5, Inventory

Attachments: Java Source File BugPlugin.java     Java Archive File bug-1.0.jar    
Version: CraftBukkit version 2991-Spigot-018b9a0-f3f3094 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

player.openInventory(player.getInventory());

This code causes player to open inventory with 41 slots (not divisible by 9) thus creating invalid state in bottom inventory of InventoryView. I've created a simple plugin to trigger that - jar and source code in attachments. Try spreading or placing items and you should see them jump around, disappear or be placed in inaccessible part of player inventory (offhand/armor).



 Comments   
Comment by Julian v.d Berkmortel [ 17/Apr/21 ]

I can't reproduce this issue. I tried to reproduce this with the "EntityPoseChangeEvent" so that when you sneek it opens the inventory using the code mentioned in the description. Is there a specific situation in which this happens?

Generated at Fri Mar 14 09:44:37 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.