Use StartupEvents.registry('skilltree:...') in kubejs/startup_scripts/ when you want to register serializer-backed PST types.
Supported registry ids:
skilltree:skill_bonusesskilltree:skill_bonus_multipliersskilltree:living_conditionsskilltree:damage_conditionsskilltree:item_conditionsskilltree:enchantment_conditionsskilltree:event_listenersskilltree:numeric_value_providersskilltree:skill_requirementsskilltree:item_bonuses
What The Checked-In Samples Cover
The file examples/kubejs/passivestjs/01_startup_registry_runtime.js shows the canonical pattern for these families:
living_conditions.prefix(...),.schema(...),.test(...)skill_bonus_multipliers.value(...)event_listeners.prefix(...),.schema(...),.onAttack(...),.onTick(...)skill_bonuses.effect(...),.schema(...),.onApply(...)skill_requirements.requirementText(...),.schema(...),.test(...)
That sample also shows schema fields with enum, int, double, resource-location, and node targets.
Minimal Pattern
var PSTSchemaFieldKind = Java.loadClass('com.pickaid.passivestjs.schema.PSTSchemaFieldKind')StartupEvents.registry('skilltree:living_conditions', event => {event.create('kubejs:sample_combat_state').prefix(context => Text.translate('living_condition.kubejs.sample_combat_state.crouching')).schema(schema => {schema.field('state', field => field.kind(PSTSchemaFieldKind.ENUM).required().enumChoice('crouching').enumChoice('underwater'))}).test(context => {var entity = context.entity()return entity != null && entity.isCrouching()})})
How Registry Definitions Are Usually Used
The normal flow is:
- Register a custom serializer-backed type in
startup_scripts. - Reference that type from
PassiveSTJSEvents.skillTreeContent(...). - Add matching translation entries in
client_scripts.
For example, a custom event listener can be referenced from a custom skill bonus, and that bonus can then be attached to a generated skill in the content event.
Schema Notes
The checked-in startup sample uses schema fields to drive both validation and authoring shape:
- simple scalar fields like
int,double, orresource_location - enum fields with explicit choices
- node fields that target a specific PST family such as
EVENT_LISTENER,LIVING_CONDITION, orMULTIPLIER
This is why the sample can chain nested builders cleanly later in skillTreeContent.