Overview
Spell entity predicates allow you to conditionally target or filter entities based on their state or properties. The More RPG Library provides custom predicates that extend the base Spell Engine predicate system.Usage
Entity predicates are typically used in spell configurations to filter which entities a spell can affect:spell.json
Available Predicates
is_on_ground
Predicate ID:more_rpg_classes:is_on_ground
Tests whether an entity is NOT on the ground.
Returns
true if the entity is airborne (not on ground)Returns false if the entity is on the groundCustomSpellEntityPredicate.java:11
Implementation:
- Aerial combat spells that only affect flying enemies
- Anti-air abilities that target airborne entities
- Spells that deal bonus damage to jumping targets
- Abilities that require the target to be in mid-air
Aerial Damage Spell
is_wet
Predicate ID:more_rpg_classes:is_wet
Tests whether an entity is NOT wet (from rain or water contact).
Returns
true if the entity is dryReturns false if the entity is wet from rain or waterCustomSpellEntityPredicate.java:15
Implementation:
- Fire spells that only work on dry targets
- Lightning spells with different behavior for wet/dry targets
- Conditional effects based on weather exposure
- Water-sensitive abilities
Fire Spell Example
is_inside_water
Predicate ID:more_rpg_classes:is_inside_water
Tests whether an entity is NOT inside water or a bubble column.
Returns
true if the entity is not in water or bubble columnsReturns false if the entity is submerged in water or standing in a bubble columnCustomSpellEntityPredicate.java:19
Implementation:
- Lightning spells that only affect submerged targets
- Water magic that requires targets to be in water
- Drowning or pressure-based abilities
- Spells that behave differently underwater
- Environmental hazard spells
Underwater Lightning Example
Predicate Logic
The naming convention might seem counterintuitive:is_on_groundreturnstruewhen entity is NOT on groundis_wetreturnstruewhen entity is NOT wetis_inside_waterreturnstruewhen entity is NOT in water
true, which means the entity does NOT meet the named condition.
Combining Predicates
You can combine multiple predicates for complex targeting logic:Combined Predicates Example
Registration
All predicates are registered during mod initialization inCustomSpellEntityPredicate.java:9:
Registration
Creating Custom Predicates
If you’re using More RPG Library as a dependency, you can register your own predicates:Custom Predicate Example
Predicate Interface
Predicates use theSpellEntityPredicates API from Spell Engine:
- Parameter:
SpellEntityContext- provides access to the entity and spell context - Return:
boolean- whether the predicate condition is met - Usage: Filtering spell targets before applying impacts
Best Practices
Predicates are evaluated before impacts are applied, making them efficient for filtering large numbers of entities.
Working with Status Effects
Combine predicates with the Soaked status effect for enhanced water-based spell interactions:Water Synergy Example