User Guides

Property Hooks

Write Shogi expression rules for mod-exposed property keys.

Goal

Use Shogi expressions to override mod-exposed properties by targeting a namespaced key.

This guide focuses on the workflow first, then uses two real keys as examples:

  • waystones:warp_requirements
  • forgivingvoid:falling_height

1. Identify the property key

Every hook target is a key in namespace:path format.

  • namespace: usually the mod id (waystones, forgivingvoid)
  • path: the exposed property id (warp_requirements, falling_height)

The key must match exactly.

2. Put rules where the mod expects them

Depending on the mod integration, rules are either:

  • in config/shogi.json keyed by the property id
  • in a mod config list field that accepts Shogi expressions

3. Write expression rules

Use expression format in regular end-user configs. Keep rules small and test incrementally.

If you need a syntax refresher first, read Rule Expression Format.

Example A: waystones:warp_requirements

Where it is commonly configured

Waystones usually exposes this through teleports.rules as a list of expressions.

Example expressions

Distance-based XP cost with interdimensional flat override:

$xp_points_cost = if(condition = is_interdimensional, then = 27, else = $distance * 0.01)
$xp_points_cost = clamp($xp_points_cost, 0, 27)

Conditional cooldown for inventory-button teleports:

is_inventory_button -> cooldown_cost('inventory_button', '300s')

Optional warp stone durability cost:

is_warp_stone -> damage_item(80)

Expected behavior

  • interdimensional teleports can use fixed costs
  • distance scaling can be clamped safely
  • cooldowns and durability can apply only for specific teleport sources

Example B: forgivingvoid:falling_height

What it controls

falling_height controls the height Forgiving Void uses when returning entities from the void.

Example expressions

Dimension-based return height:

is_dimension('minecraft:the_nether') -> 180
is_dimension('minecraft:the_end') -> 256
220

Safe clamped integer pattern:

$target_height = 220
$target_height = clamp($target_height, 128, 320)
$target_height

Expected behavior

  • different dimensions can return at different heights
  • fallback values keep behavior predictable
  • clamping prevents out-of-range results

Troubleshooting

  • Parse error: check ->, commas, +, and quoting.
  • Unknown function/effect: name is not available in the active scope.
  • Rule has no effect: condition may not match real runtime context.
  • Wrong target: verify full key spelling and namespace.

For JSON equivalents and translation patterns, see Advanced: Using JSON.