Skip to content

InventoryComponent

Package: com.hypixel.hytale.server.core.inventory

public abstract class InventoryComponent implements Component<EntityStore>

Abstract base for all inventory section components (hotbar, storage, armor, utility, tools, backpack). Each concrete subclass represents one inventory section attached to an entity via the ECS. Manages dirty tracking, change event registration, and codec-based serialization. Provides static helper methods to retrieve combined inventory views across multiple sections.

ModifierTypeNameValue
public static finalbyteINACTIVE_SLOT_INDEX-1
public static finalshortDEFAULT_HOTBAR_CAPACITY9
public static finalshortDEFAULT_UTILITY_CAPACITY4
public static finalshortDEFAULT_TOOLS_CAPACITY23
public static finalshortDEFAULT_ARMOR_CAPACITY(short)ItemArmorSlot.VALUES.length
public static finalshortDEFAULT_STORAGE_ROWS4
public static finalshortDEFAULT_STORAGE_COLUMNS9
public static finalshortDEFAULT_STORAGE_CAPACITY36
public static finalintHOTBAR_SECTION_ID-1
public static finalintSTORAGE_SECTION_ID-2
public static finalintARMOR_SECTION_ID-3
public static finalintUTILITY_SECTION_ID-5
public static finalintTOOLS_SECTION_ID-8
public static finalintBACKPACK_SECTION_ID-9
ModifierTypeName
public static finalBuilderCodec<InventoryComponent>CODEC
public staticComponentType<EntityStore, ? extends InventoryComponent>[]HOTBAR_STORAGE_BACKPACK
public staticComponentType<EntityStore, ? extends InventoryComponent>[]HOTBAR_FIRST
public staticComponentType<EntityStore, ? extends InventoryComponent>[]STORAGE_FIRST
public staticComponentType<EntityStore, ? extends InventoryComponent>[]BACKPACK_STORAGE_HOTBAR
public staticComponentType<EntityStore, ? extends InventoryComponent>[]BACKPACK_HOTBAR_STORAGE
public staticComponentType<EntityStore, ? extends InventoryComponent>[]STORAGE_HOTBAR_BACKPACK
public staticComponentType<EntityStore, ? extends InventoryComponent>[]ARMOR_HOTBAR_UTILITY_STORAGE
public staticComponentType<EntityStore, ? extends InventoryComponent>[]HOTBAR_UTILITY_CONSUMABLE_STORAGE
public staticComponentType<EntityStore, ? extends InventoryComponent>[]EVERYTHING
ModifierSignature
publicInventoryComponent()
publicInventoryComponent(short capacity)
ModifierReturn TypeSignature
publicvoidensureCapacity(short capacity, List<ItemStack> remainder)
publicvoidmarkDirty()
publicbooleanconsumeIsDirty()
publicbooleanconsumeNeedsSaving()
publicItemContainergetInventory()
publicConcurrentLinkedQueue<ItemContainer.ItemContainerChangeEvent>getChangeEvents()
public abstractComponent<EntityStore>clone()
public staticvoidsetupCombined(ComponentType<EntityStore, Storage> storageInventoryComponentType, ComponentType<EntityStore, Armor> armorInventoryComponentType, ComponentType<EntityStore, Hotbar> hotbarInventoryComponentType, ComponentType<EntityStore, Utility> utilityInventoryComponentType, ComponentType<EntityStore, Backpack> backpackInventoryComponentType, ComponentType<EntityStore, Tool> toolInventoryComponentType)
public staticComponentType<EntityStore, ? extends InventoryComponent>getComponentTypeById(int id)
public staticCombinedItemContainergetCombined(ComponentAccessor<EntityStore> accessor, Ref<EntityStore> ref, ComponentType<EntityStore, ? extends InventoryComponent>... types)
public staticCombinedItemContainergetCombined(CommandBuffer<EntityStore> commandBuffer, ArchetypeChunk<EntityStore> archetypeChunk, int index, ComponentType<EntityStore, ? extends InventoryComponent>... types)
public staticItemStackgetItemInHand(ComponentAccessor<EntityStore> accessor, Ref<EntityStore> ref)
ClassDescription
InventoryComponent.ArmorArmor inventory section with slot filters
InventoryComponent.BackpackResizable backpack inventory section
InventoryComponent.CombinedCache for combined multi-section item containers
InventoryComponent.HotbarHotbar inventory section with active slot tracking
InventoryComponent.StorageMain storage inventory section
InventoryComponent.ToolTool inventory section with active slot and wielding state
InventoryComponent.UtilityUtility inventory section with slot filters and active slot
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.