Skip to content

ItemContainerAccess

Locates the ItemStack backing a ComposeItemContainerMenu and reports whether it's still valid to keep the menu open.

Inheritors

Functions

getStack

abstract fun getStack(): ItemStack

Resolves the current backing ItemStack. Must be re-resolved fresh on every call, not cached - the underlying stack reference can be swapped out from under the menu (e.g. by another mod replacing the inventory slot's stack wholesale), and a cached reference would silently go stale rather than reflect that.

stillValid

abstract fun stillValid(player: Player): Boolean

Whether player should still be allowed to keep this menu open.