Component
Package: com.hypixel.hytale.component
public interface Component<ECS_TYPE> extends CloneableThe root interface for all ECS components. Every piece of per-entity data in the ECS framework implements this interface. Components are stored in ArchetypeChunk arrays and accessed via ComponentType handles.
Components must be cloneable because the ECS serialization, entity copying, and archetype migration operations all require deep copies of component data.
Type Parameters
Section titled “Type Parameters”ECS_TYPE— the store type parameter (e.g.,EntityStoreorChunkStore)
Fields
Section titled “Fields”@NonnullComponent[] EMPTY_ARRAY = new Component[0];Shared empty array constant used as a default when no components are present.
Methods
Section titled “Methods”@NullableComponent<ECS_TYPE> clone();Creates a deep copy of this component. Returns null if the component cannot be cloned.
@Nullabledefault Component<ECS_TYPE> cloneSerializable()Creates a copy containing only serializable state. Defaults to calling clone(). Override this when a component contains transient runtime data that should be excluded from persistence.
Related Types
Section titled “Related Types”- ComponentType — typed handle used to register and access components in the ECS
- ArchetypeChunk — stores component arrays for entities sharing the same archetype
- Store — the ECS store that manages entities and their components
- Resource — the equivalent interface for per-store singleton data
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.