Skip to content

BuilderModifier

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

public class BuilderModifier

Represents a "Modify" block in NPC JSON configuration that overrides parameters, exports state mappings, provides combat config overrides, and supplies interaction variables when referencing a component. The modifier creates a new expression scope that merges parameter overrides with the referenced builder’s parameters.

ConstantTypeValue
KEY_MODIFYString"Modify"
KEY_EXPORT_STATESString"_ExportStates"
KEY_INTERFACE_PARAMETERSString"_InterfaceParameters"
KEY_COMBAT_CONFIGString"_CombatConfig"
KEY_INTERACTION_VARSString"_InteractionVars"
protected BuilderModifier(Object2ObjectMap<String, ExpressionHolder> builderExpressionMap, StatePair[] exportedStateIndexes, StateMappingHelper stateHelper, String combatConfig, Map<String, String> interactionVars)
public String getCombatConfig()
public Map<String, String> getInteractionVars()
public boolean isEmpty()

Returns true if no parameter overrides are defined.

public int exportedStateCount()

Returns the number of exported state pairs.

applyComponentStateMap / popComponentStateMap

Section titled “applyComponentStateMap / popComponentStateMap”
public void applyComponentStateMap(@Nonnull BuilderSupport support)
public void popComponentStateMap(@Nonnull BuilderSupport support)

Pushes and pops state mapping overrides on the BuilderSupport.

@Nonnull
public Scope createScope(@Nonnull BuilderSupport builderSupport, @Nonnull BuilderParameters builderParameters, Scope globalScope)

Creates a merged expression scope containing parameter overrides.

@Nonnull
public static BuilderModifier fromJSON(@Nonnull JsonObject jsonObject, @Nonnull BuilderParameters builderParameters, @Nonnull StateMappingHelper helper, @Nonnull ExtraInfo extraInfo)

Parses a "Modify" JSON block. Returns EmptyBuilderModifier if the block is absent or empty.

public static void readModifierObject(@Nonnull JsonObject jsonObject, @Nonnull BuilderParameters builderParameters, @Nonnull StringHolder holder, @Nonnull Consumer<StringHolder> referenceConsumer, @Nonnull Consumer<BuilderModifier> builderModifierConsumer, @Nonnull StateMappingHelper helper, @Nonnull ExtraInfo extraInfo)

Reads a JSON object containing both a "Reference" and a "Modify" block.

Holds a default expression and optional interface-mapped expressions for parameter overrides.

Generates the JSON Schema for the modifier block.

Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.