Skip to content

StashPlugin.StashSystem

Package: com.hypixel.hytale.builtin.adventure.stash

private static class StashPlugin.StashSystem extends RefSystem<ChunkStore>

Inner ECS system of StashPlugin that runs on the chunk store. Registered during StashPlugin.setup(). Listens for chunk-store entities that have both an ItemContainerBlock and a BlockModule.BlockStateInfo component. When such an entity is added (e.g., a stash container block placed or loaded into the world), the system populates the container’s inventory from its drop list by calling StashPlugin.stash, provided the world is not in Creative mode.

ModifierTypeName
@Nonnull private finalComponentType<ChunkStore, ItemContainerBlock>itemContainerStateComponentType
@Nonnull private finalComponentType<ChunkStore, BlockModule.BlockStateInfo>blockStateInfoComponentType
@Nonnull private finalQuery<ChunkStore>query
ModifierSignature
publicStashSystem(@Nonnull ComponentType<ChunkStore, ItemContainerBlock> itemContainerStateComponentType)
ModifierReturn TypeSignature
@Override publicQuery<ChunkStore>getQuery()
@Override publicvoidonEntityAdded(@Nonnull Ref<ChunkStore> ref, @Nonnull AddReason reason, @Nonnull Store<ChunkStore> store, @Nonnull CommandBuffer<ChunkStore> commandBuffer)
@Override publicvoidonEntityRemove(@Nonnull Ref<ChunkStore> ref, @Nonnull RemoveReason reason, @Nonnull Store<ChunkStore> store, @Nonnull CommandBuffer<ChunkStore> commandBuffer)
  • The query is Query.and(itemContainerStateComponentType, blockStateInfoComponentType).
  • onEntityAdded skips processing if the world game mode is GameMode.Creative.
  • Reads the StashGameplayConfig from the world’s gameplay config to determine whether to clear the container drop list after populating.
  • Delegates to StashPlugin.stash for the actual item placement logic.
  • onEntityRemove is a no-op.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.