Skip to content

Enchantment Core Registries

Byoune edited this page Sep 19, 2026 · 3 revisions

Manages custom dynamic registries required for the modular spell field system. Initializes registry keys, registers suppliers for custom registries, and caches dispatch codecs for polymorphic serialization and deserialization.

Registry Keys & Suppliers

Defines the core ResourceKey and Supplier<Registry> objects for the custom spell field components.

Component Resource Key Supplier
Distance Scaling Functions enchantment_core:distance_scaling_function DISTANCE_SCALING_FUNCTIONS
Spell Field Shapes enchantment_core:spell_field_shape SPELL_FIELD_SHAPES
Spell Field Effects enchantment_core:spell_field_effect SPELL_FIELD_EFFECTS

Dispatch Codec Getters

Provides cached dispatch codecs to allow polymorphic JSON resolution for the various spell field components. The effect codecs are strictly typed to reject generic effects that do not implement the required targeting contract.

Method Description
getDistanceScalingFunctionCodec() Retrieves the polymorphic codec for mathematical falloff algorithms.
getSpellFieldShapeCodec() Retrieves the polymorphic codec for geometric bounding structures.
getSpellFieldEntityEffectCodec() Filters and retrieves effects implementing the SpellFieldEntityEffect contract.
getSpellFieldBlockEffectCodec() Filters and retrieves effects implementing the SpellFieldBlockEffect contract.
getSpellFieldVolumeEffectCodec() Filters and retrieves effects implementing the SpellFieldVolumeEffect contract.
getSpellFieldVisualEffectCodec() Filters and retrieves effects implementing the SpellFieldVisualEffect contract.
initialize() Initializes the custom registries during the mod setup phase.

Clone this wiki locally