inventoryContents

var inventoryContents: Array<ItemStack?>

Array containing the player's main inventory contents.

This array represents the 36 slots of a player's main inventory (9x4 grid). Each slot can contain an ItemStack or be null for empty slots. The inventory is persisted to the database using NBT serialization.

Array Structure:

  • Indices 0-8: Hotbar slots

  • Indices 9-35: Main inventory slots

  • Null entries represent empty slots

Persistence: Stored in the player_inventory table with slots 0-35. Dirty Tracking: Always marked dirty on assignment (deep comparison is complex).

See also

ItemStack