Skip to content

Custom Reactions with KubeJS Integration 2.x to 3.0 Migration Guide

Hyperlynx edited this page Feb 11, 2025 · 3 revisions

In KubeJS Integration Version 3.0 (Reactive Version 9.17.0), Reactions no longer require registration at startup, and their advancements have a different format. This guide will show these differences and how to adapt to them.

No more ReactionMan.CRITERIA_BUILDER

ReactionMan.CRITERIA_BUILDER has been completely removed, so scripts using it will break. You can safely remove these lines from your StartupEvents.init handler:

ReactionMan.CRITERIA_BUILDER.add("example_reaction")

You no longer need to reserve reaction aliases at all. Instead, collisions just cause that line to fail to create a reaction, with a line in the server log file describing why.

Different advancement criteria for reactions

Reactions now all use the same kind of trigger: reactive:reaction. This criterion requires that its conditions block contain the alias of the reaction it's testing for.

This is what your existing reaction advancements should look like:

# OLD FORMAT EXAMPLE!
{
  "criteria": {
    "criterion": {
      "trigger": "reactive:reaction/test_reaction_criterion"
    }
  },
  "requirements": [
    [
      "criterion"
    ]
  ]
}

And this is how they need to be formatted now:

{
  "criteria": {
    "criterion": {
      "conditions": {
        "reaction_alias": "test_reaction"
      },
      "trigger": "reactive:reaction"
    }
  },
  "requirements": [
    [
      "criterion"
    ]
  ]
}

Note that the alias in "reaction_alias" must match the one you register the reaction with.

There is also a trigger for the "perfection" advancements: reactive:perfect_reaction.