Customization

Simple legacy rules can be written directly in the rules config option. Datapack rulesets are useful when a modpack or mod wants to ship reusable named rulesets that players can enable with the rulesets config option.

Simple legacy rules can be written directly in the rules config option. Datapack rulesets are useful when a modpack or mod wants to ship reusable named rulesets that players can enable with the rulesets config option.

Legacy ruleset files are placed under:

data/<ruleset_namespace>/unbreakables/<ruleset_path>.json

The <ruleset_namespace>:<ruleset_path> part is the id used in the config. For example, data/example/unbreakables/protected_spawner.json can be enabled with:

rulesets = ["example:protected_spawner"]

Legacy ruleset files contain a rules array using the 1.20.1/1.21.1 rule format:

{
  "rules": [
    "[is_block(minecraft:spawner)] refuse(You cannot break this block.)"
  ]
}

Waystones 1.20.1 and 1.21.1 ship with the following ruleset that can be enabled in Unbreakables:

{
  "rules": [
    "[is_tag(waystones:waystones), is_not_state(origin, player)] refuse($chat.waystones.cannot_break_waystone)"
  ]
}

Players enable that packaged ruleset by adding this to config/unbreakables-common.toml:

rulesets = ["waystones:generated_waystones"]