Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
Data Criteria

Data Criteria

Data-driven advancement criteria

1,373
5
Library
AboutChangelogVersions

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

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Compatibility

Minecraft: Java Edition

1.20–1.20.1
1.19.x
1.18.2

Platforms

Fabric
Quilt

Supported environments

Server-side

Links

Report issues View source Visit wiki Join Discord server

Creators

spadeteam
spadeteamOrganization

Details

Licensed MIT
Published 2 years ago
Updated last year

Modrinth is open source.

main@aaf125c

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.