Overview
Entity predicates allow you to add conditions to your spells that check the state of the caster or target. More RPG Library adds several predicates focused on environmental conditions.Available Predicates
The library registers three custom entity predicates:is_on_ground
ID:more_rpg_classes:is_on_ground
Checks if the entity is not on the ground (i.e., airborne).
Despite the name, this predicate returns
true when the entity is NOT on the ground. This is for use with spell conditions that prevent casting.is_wet
ID:more_rpg_classes:is_wet
Checks if the entity is not wet (not in water or rain).
is_inside_water
ID:more_rpg_classes:is_inside_water
Checks if the entity is not inside water or a bubble column.
Usage in Spells
Entity predicates are used in thespell_entity_requirements section of your spell configuration to add casting conditions.
Basic Syntax
spell.json
Examples
Ground-Only Spells
Create a spell that can only be cast while on the ground:earth_slam.json
Water-Required Spells
Create a spell that requires the caster to be in water:tidal_wave.json
Because the predicate checks for NOT in water, it will prevent casting when the condition is true (not in water). To require water, you may need to combine this with other conditions or use inverted logic depending on your Spell Engine version.
Dry Environment Spells
Create a fire spell that can’t be cast while wet:flame_burst.json
Combining Multiple Predicates
You can combine multiple predicates for more complex conditions:aerial_strike.json
- Airborne (not on ground)
- Not wet
Understanding Predicate Logic
Creating Themed Spell Sets
Air Magic Theme
Spells that require being airborne:- Updraft
- Aerial Dash
- Wind Blast
- Sky Strike
Water Magic Theme
Spells that require water:- Tidal Wave
- Whirlpool
- Water Breathing
- Aqua Jet
Fire Magic Theme
Spells that require dry conditions:- Inferno
- Flame Wall
- Combustion
- Heat Wave
Advanced Usage
Combining with Spell Engine Predicates
You can combine More RPG Library predicates with standard Spell Engine predicates:spell.json
Creating Situational Spells
Use predicates to create spells with interesting situational uses:Implementation Details
The predicates are registered in the library’s initialization:CustomSpellEntityPredicate.java
common/src/main/java/net/more_rpg_classes/custom/CustomSpellEntityPredicate.java:9
Troubleshooting
Predicate Not Working
Check Spell Engine version
Ensure you’re using a compatible version of Spell Engine that supports custom entity predicates.
Verify predicate ID
Make sure you’re using the correct predicate ID:
more_rpg_classes:is_on_ground, not is_on_ground.Spell Always/Never Castable
If your spell is always castable or never castable:- Check that the predicate array is properly formatted in your JSON
- Verify that you’re testing in the correct environment (in water, on ground, etc.)
- Check the Spell Engine documentation for how predicates are evaluated