PaperMC / PaperMC/Paper

getStorageInventory() for player custom inventories does not match with getStorageInventory() for players

Open
#13,154 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

When running Player#getInventory().getStorageContents(), you get the items in a player inventory that excludes the equipment slots. This should be the same as Bukkit.createInventory(InventoryType.PLAYER).getStorageContents()

Observed/Actual behavior

However, Bukkit.createInventory(InventoryType.PLAYER).getStorageContents() is equivalent to getContents() and does include the items in the equipment slots.

Steps/models to reproduce
Player player = ...
player.getInventory().getStorageContents().size() // 36

Bukkit.createInventory(player, InventoryType.PLAYER).getStorageContents().size() // 43
Plugin and Datapack List

n/a

Paper version

491c41257c88b5ed3f33f6f21b274a37810e094c

Other

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Player#getInventory().getStorageContents() and Bukkit.createInventory(InventoryType.PLAYER).getStorageContents(), then compare their handling of equipment slots with getContents(). Reproduce the reported 36-slot and 43-slot results. Done means both player inventory variants consistently exclude equipment slots from getStorageContents().

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.