-
Notifications
You must be signed in to change notification settings - Fork 0
Spell Field Anchors
The SpellFieldAnchorEntity is the invisible backbone of all lingering, cyclical, or delayed Spell Field operations.
Standard spell fields evaluate instantly on the exact tick they are triggered. If you need to create a lingering Area of Effect (such as a persistent healing aura, a pulsing poison cloud, or a slow-pulling black hole), you must encapsulate your spell_field component within a summon_spell_field_anchor effect.
When executed, this un-targetable, physics-immune entity is spawned into the world to manage your nested spell field over time.
An anchor operates on a precise temporal cycle, defined by the parameters passed into the summon_spell_field_anchor effect payload:
-
duration(Life Time): The total amount of time (in ticks) the anchor will exist in the world before automatically despawning. -
activation_delay: An initial grace period (in ticks) after spawning before the anchor evaluates its spell field for the first time. -
tick_rate: The frequency (in ticks) at which the nested spell field is evaluated during an active phase. For example, atick_rateof20will pulse the effect once every second. -
active_phase&rest_phase: These parameters define an oscillation cycle. The anchor will evaluate the spell field according to itstick_rateduring the Active Phase, then completely pause during the Rest Phase.- If
active_phaseis omitted or set to0, the anchor remains active for its entire lifespan.
- If
This cyclic phase system allows for complex temporal behaviors. For example, you can create a magical trap that arms itself after 2 seconds (activation_delay), pulses damage rapidly for 3 seconds (active_phase), goes dormant to "recharge" for 5 seconds (rest_phase), and then repeats until its total duration expires.
While anchors are inherently invisible, you can attach rendering logic to them. See the Custom Anchor Rendering guide in the Advanced Implementations chapter to learn how to bind 2D sprites and custom 3D models to your anchors.
Want to learn more about the configuration engine powering Enchantment Core?
Check out Config Understood, the official wiki for Config Overhauled, for a deep dive into dynamic property generation and state synchronization!