Skip to content

BuilderCombatConfig

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

public class BuilderCombatConfig extends BuilderCodecObjectHelper<String>

A codec object helper specialized for NPC combat configuration. Reads a combat config reference (either inline JSON object or a string reference to a BalanceAsset) and supports runtime override via ExecutionContext.getCombatConfig().

FieldTypeDescription
inlinebooleanWhether the config was provided as an inline JSON object rather than a string reference.
public BuilderCombatConfig(Codec<String> codec, Validator<String> validator)
public String build()

Throws UnsupportedOperationException. Use build(ExecutionContext) instead.

@Nullable
public String build(@Nonnull ExecutionContext context)

Returns the combat config string. If the execution context provides an override via getCombatConfig(), that value is used; otherwise the value read from JSON is returned.

@Override
public void readConfig(@Nonnull JsonElement data, @Nonnull ExtraInfo extraInfo)

Records whether the config is inline, then delegates to the parent codec reader.

public boolean validate(String configName, NPCLoadTimeValidationHelper loadTimeValidationHelper, @Nonnull ExecutionContext context, @Nonnull List<String> errors)

Validates that any override combat config string refers to an existing BalanceAsset.

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