Перейти к содержимому
Mineforgian

Data Criteria

Data-driven advancement criteria

Загрузки
2K
Подписчики
5
Обновлён
17 июля 2023 г.
Лицензия
MIT

Опубликован 21 декабря 2022 г.

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

Ченджлог

1.0.1+1.20Релиз1.20, 1.20.1 · 17 июля 2023 г.
  • Fixed resource reloading
1.0.1+1.19.4Релиз1.19.4 · 17 июля 2023 г.
  • Fixed resource reloading
1.0.1+1.19Релиз1.19, 1.19.1, 1.19.2 · 17 июля 2023 г.
  • Fixed resource reloading
1.0.0+1.20Релиз1.20 · 8 июня 2023 г.
  • Updated to 1.20
1.0.0+1.18.2Релиз1.18.2 · 24 марта 2023 г.
  • Backported to 1.18.2
1.0.0+1.19.4Релиз1.19.4 · 22 марта 2023 г.
  • Updated to 1.19.4
1.0.0+1.19.3Релиз1.19.3 · 31 декабря 2022 г.
  • Ported to 1.19.3
1.0.0+1.19Релиз1.19, 1.19.1, 1.19.2 · 27 декабря 2022 г.
  • Fixed even more null checking (now it's not fromJson's problem).

Комментарии

Загружаем…