Conditions System

What is the Conditions System?

Conditions (Nexus Condition API) are a powerful, config-driven system for evaluating states and rules across our plugin suite. You can define unlimited conditions in any supported configuration section—anywhere conditions are supported or required. Conditions are typically used to control logic (e.g., whether something is allowed to run, whether an event is valid, or which path/option should be selected) and can be evaluated individually or combined for more complex checks.

Conditions can also be paired with requirements to enforce additional prerequisites and provide clear feedback on why a check failed.

Here’s an example configuration that includes conditions

drop-items:
  - item: iron_ingot
    amount: 1-3
    chance: 100
    # Our Nexus Condition API
    conditions: { }
    # Our Nexus Actions API
    actions: { }

Example: Adding a Condition (Above-Block Requirement)

In this example, we add one condition using the above-block requirement to validate the block above the target location.

This setup is intended to:

  • Check whether the block one block above the target block (taking the configured offset into account) is air

  • Require the target block itself to be sand

  • Use an offset value of 1, meaning the block one block above the target block must match the configured block type

With this condition, you can verify that the block above a sand block is air and only then allow the block break.

This is especially useful when using a regen plugin, as it helps prevent cactus from breaking when the supporting sand block is removed.

Last updated