Skip to content

com.hypixel.hytale.server.npc.asset.builder

Package: com.hypixel.hytale.server.npc.asset.builder

Implements the JSON-driven builder/factory system for NPC configuration. NPC roles are defined in JSON files under Server/NPC/Roles/. The BuilderManager loads these files, selects the appropriate BuilderFactory by category, and instantiates typed builders that read JSON, validate it, and produce runtime objects (Roles, Actions, Sensors, BodyMotions, HeadMotions, Instructions, etc.).

The package also provides the infrastructure for expression-evaluated parameters, state machine mapping, feature provider evaluation, slot allocation, and schema generation.

TypeKindDescription
BuilderinterfaceThe root interface for all NPC asset builders.
BuilderBaseabstract classAbstract base implementation with attribute reading infrastructure.
BuilderBaseWithTypeabstract classAdds a secondary Type field; implements ISpawnable.
SpawnableWithModelBuilderabstract classExtends BuilderBase for spawnable entities with models and dynamic dependencies.
BuilderComponentclassGeneric component wrapper; automatically registered by every factory.
TypeKindDescription
BuilderFactoryclassCreates builders by type discriminator from a named registry.
BuilderManagerclassCentral manager for loading, caching, validating, and hot-reloading builders.
BuilderInfoclassMetadata about a loaded builder (index, name, path, validation state).
TypeKindDescription
BuilderObjectHelperabstract classBase for helpers that read JSON and produce typed objects.
BuilderObjectReferenceHelperclassResolves inline, file, or internal builder references.
BuilderObjectArrayHelperabstract classReads JSON arrays of builder objects.
BuilderObjectListHelperclassProduces a List<T> from a JSON array.
BuilderObjectMapHelperclassProduces a Map<K, V> from a JSON array with key extraction.
BuilderObjectStaticHelperclassEnforces inline-only (no references).
BuilderObjectStaticListHelperclassList of inline-only builders.
BuilderCodecObjectHelperclassReads JSON via a Codec<T>.
BuilderCombatConfigclassCombat configuration with runtime override.
BuilderTemplateInteractionVarsclassInteraction variable maps with runtime override.
TypeKindDescription
BuilderParametersclassParameter definitions, expression scope, and dependency tracking.
BuilderModifierclass"Modify" block: parameter overrides, state exports, combat config, interaction vars.
EmptyBuilderModifierclassSingleton null-object modifier.
BuilderContextinterfaceHierarchical breadcrumb context for error reporting.
BuilderSupportclassRuntime context during build(): entity, slots, instructions, events, state.
BuilderValidationHelperclassBundles validation context objects.
TypeKindDescription
BuilderDescriptorclassBuilder schema for documentation/validation generation.
BuilderAttributeDescriptorclassSingle attribute schema with fluent configuration.
BuilderDescriptorStateenumLifecycle state: Unknown, WorkInProgress, Experimental, Stable, Deprecated.
TypeKindDescription
SlotMapperclassMaps names to sequential integer slots.
ReferenceSlotMapperclassExtends SlotMapper with lazily-created reference objects.
EventSlotMapperclassAllocates event observation slots by type and set.
TypeKindDescription
StateMappingHelperclassTwo-level state name/index mapping with validation.
StatePairclassImmutable (fullStateName, mainIndex, subIndex) tuple.
TypeKindDescription
FeatureOverrideenumThree-state override for NPC builder features (On, Off, Default).
TypeKindDescription
FeatureenumTarget types: Player, NPC, Drop, Position, Path.
FeatureEvaluatorHelperclassManages feature provider evaluation and requirements.
TypeKindDescription
InstructionTypeenumInstruction contexts: Default, Interaction, Death, Component, StateTransitions.
ComponentContextenumSensor contexts: SensorSelf, SensorTarget, SensorEntity.
InstructionContextHelperclassValidates instruction/component context compatibility.
TypeKindDescription
InternalReferenceResolverclassResolves local builder references within a file; detects cycles.

This package has several sub-packages (documented separately):

  • expression — Expression types for dynamic JSON values (static and dynamic boolean, number, string, and array expressions).
  • holder — Typed value holder classes for validated field storage.
  • providerevaluators — Feature and parameter provider evaluators.
  • validators — Attribute and asset validators.
  • util — Utility classes.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.