<aside> 🛠️ REALISTIC FIRE · DEVELOPER GUIDE Source reference for version 1.1.0 · Fanconma

</aside>

Use this guide to navigate the source, add reaction rules and test changes. For player-facing settings and behavior, see the Documentation.

Project layout

The behavior and resource packs declare matching, bidirectional UUID dependencies in their manifests. Keep the existing UUIDs and betterfire: dynamic-property namespace when updating an existing installation.

Execution flow

Commands are registered during system.beforeEvents.startup. After world load, configuration is read and the simulation is scheduled. Each job discovers sources around players, heats adjacent and sampled blocks, applies eligible reactions, processes queued collapse and entity radiation, and cools stored entries. Work is distributed through system.runJob; a new job is not started while the preceding one is running.

Adding a block reaction

Edit scripts/rules.js. Inspect the existing exact rules first: exact block-ID matches take priority over pattern rules, and rule lookups are cached. Follow the representation already used by the surrounding entries rather than pasting a rule into a different structure.

A rule may specify feature, threshold, chance, minSourceHeat, result, state, sound, particle, drop, spill and spawnFire. result is a list of candidate block IDs, or a function returning one; candidates are tried in order. state changes a block state rather than replacing its type. Hard difficulty bypasses minSourceHeat.

// Example rule object; add under an unused block ID using the local table’s syntax.
{
  feature: "charWood",
  threshold: 60,
  chance: 0.25,
  minSourceHeat: 12,
  result: ["minecraft:fire", "minecraft:air"],
  label: "Custom combustible"
}

Choose an actual block ID supported by the target game version, check for an existing exact or pattern match, and test the change on an isolated block with a suitable source. Verify both the enabled and disabled feature paths. Do not assume the first reaction check occurs at a fixed elapsed time.

<aside> 📷 IMAGE DEV1 — Add a screenshot showing the rule in the editor and the matching isolated test setup in-game. Use two separate images if the code would be too small to read.

</aside>

States and container contents

For a replacement, the effects code attempts to carry compatible, non-volatile block states to the new permutation. State names and values can differ between blocks; test orientation and multi-block structures in-game.

Container transitions snapshot and clear accessible slots before replacement, then attempt restoration or scattering. Spilling and restoration depend on available components and successful item spawns; they are not transactional. Falling block entities may lose processing progress or other data. Test with disposable items and keep a world backup.