Condition
Conditions are used to test against a given context, checking the provided information and return either a pass or fail.
Custom conditions can be defined as JSON/JSON5/JSONC files in the data/<namespace>/kaya/condition directory of a data pack. Data packs that load later with a condition file with the same name and directory will replace the existing condition.
Note
Some conditions require certain context parameters to function properly. Make sure to check the page for the desired condition type for more information.
Format
| Field | Type | Default | Description |
|---|---|---|---|
type |
Identifier | The identifier of the desired condition type. |
Tip
Specifying a boolean will implicitly use the constant condition type.
Meta types
all_ofany_ofcompareconstantdifficultydynamicinvertedparameter_existsprovide_contextreference
Types
block_state_propertycheck_block_typecheck_damage_typecheck_effect_typecheck_entity_typecheck_precipitationentity_has_active_powerentity_has_correct_tool_for_blockentity_has_item_equippedentity_has_powerentity_has_pressed_keyis_block_entityis_block_replaceableis_entity_climbingis_entity_fall_flyingis_entity_horizontally_collidingis_entity_on_fireis_entity_owned_by_otheris_entity_sneakingis_entity_sprintingis_entity_stepping_on_blockis_exposed_to_skyitem_matches_ingredientitem_matches_predicatematches_block_patternis_sky_visible