Data Criteria

Data Criteria

Data-driven advancement criteria

2 030 downloads 5 followers

Why?

Check out this page for an example of creating advancement criteria without this mod. See the rest of the wiki for complete documentation.

Example

1 - Create a criterion file. parameters is an ordered list of parameter names and types to pass in and check for. Make sure to group optional parameters at the end.

data/namespace/criteria/int_and_bool.json

{
  "parameters": [
    {
      "name": "number",
      "type": "datacriteria:int"
    },
    {
      "name": "possible",
      "type": "datacriteria:bool",
      "optional": true
    }
  ]
}

2 - Use the criterion within an advancement file.

{
  // ...
  "criteria": {
    "test": {
      "trigger": "namespace:int_and_bool",
      "conditions": {
        "number": 5,
        // As 'possible' is optional, it's not required in the conditions
      }
    }
  }
  // ...
}

3 - Trigger the criterion through DataCriteriaAPI.

DataCriteriaAPI.trigger(
    new Identifier("namespace:int_and_bool"),
    serverPlayer,
    // The parameters begin here
    10, true
);

License

MIT © 2022 spadeteam

No gallery available for this project.

Version Minecraft Loader Download

1.0.1

1.0.1+1.20

1.20, 1.20.1
fabric, quilt
Download

1.0.1

1.0.1+1.19.4

1.19.4
fabric, quilt
Download

1.0.1

1.0.1+1.19

1.19, 1.19.1, 1.19.2
fabric, quilt
Download

1.0.0

1.0.0+1.20

1.20
fabric, quilt
Download

1.0.0

1.0.0+1.18.2

1.18.2
fabric, quilt
Download

1.0.0

1.0.0+1.19.4

1.19.4
fabric, quilt
Download

1.0.0

1.0.0+1.19.3

1.19.3
fabric, quilt
Download

1.0.0

1.0.0+1.19

1.19, 1.19.1, 1.19.2
fabric, quilt
Download

1.0.0 Beta 2

1.0.0-beta.2+1.19

1.19, 1.19.1, 1.19.2
fabric, quilt
Download

1.0.0 Beta 1

1.0.0-beta.1+1.19.3

1.19.3
fabric, quilt
Download

1.0.0 Beta 1

1.0.0-beta.1+1.19

1.19, 1.19.1, 1.19.2
fabric, quilt
Download