Advanced
Using JSON
Learn how to define Shogi rules in JSON instead of expressions.
Expression vs JSON
Shogi supports both:
- expression syntax (short, config-friendly)
- JSON syntax (explicit, structured)
Expressions are easier to read and more concise. Use JSON only when you need complex structure that would get messy within expressions.
Minimal JSON anatomy
A Shogi JSON rule usually includes:
type: the effect/operation identifier- effect-specific fields: parameters consumed by that type
Example concepts:
- constants use
shogi:constantwith a value field - conditions and branches use types such as
shogi:if - custom mod effects use their own namespaced
type
Translation example
Expression:
is_dimension('minecraft:the_nether') -> failure('Disabled in the Nether')
Equivalent JSON shape:
{
"type": "shogi:if",
"condition": {
"type": "shogi:is_dimension",
"dimension": "minecraft:the_nether"
},
"then": {
"type": "shogi:failure",
"message": "Disabled in the Nether"
}
}