{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://json.schemastore.org/minecraft-predicate.json","$comment":"https://minecraft.wiki/w/Predicate","allOf":[{"if":{"properties":{"conditions":{"const":"minecraft:alternative"}}},"then":{"properties":{"terms":{"title":"Terms","description":"A list of conditions to join using 'or'.","type":"object"}}}},{"if":{"properties":{"conditions":{"const":"minecraft:block_state_property"}}},"then":{"properties":{"block":{"title":"Block","description":"A block ID.","type":"string"},"properties":{"title":"Properties","description":"A map of block property names to values.","type":"object","additionalProperties":{"type":"string"}}}}},{"if":{"properties":{"conditions":{"const":"minecraft:damage_source_properties"}}},"then":{"properties":{"predicate":{"$ref":"#/definitions/tagsCommonToAllDamageTypes","title":"Predicate","description":"Predicate applied to the damage source."}}}},{"if":{"properties":{"conditions":{"const":"minecraft:entity_properties"}}},"then":{"description":"Test properties of an entity.","properties":{"entity":{"title":"Entity","description":"Specifies the entity to check for the condition.","type":"string","enum":["this","killer","killer_player"]},"predicate":{"$ref":"#/definitions/tagsCommonToAllEntities","title":"Predicate","description":"Predicate applied to entity."}}}},{"if":{"properties":{"conditions":{"const":"minecraft:entity_scores"}}},"then":{"description":"Test the scoreboard scores of an entity.","properties":{"entity":{"title":"Entity","description":"Specifies the entity to check for the condition.","type":"string","enum":["this","killer","killer_player"]},"scores":{"title":"Scores","description":"Scores to check. All specified scores must pass for the condition to pass.","type":"object","additionalProperties":{"$ref":"#/definitions/integerRange","type":["integer","object"]}}}}},{"if":{"properties":{"conditions":{"const":"minecraft:inverted"}}},"then":{"description":"Inverts condition from parameter term.","properties":{"term":{"title":"Term","description":"The condition to be negated.","type":"object"}}}},{"if":{"properties":{"conditions":{"const":"minecraft:killed_by_player"}}},"then":{"description":"Test if a killer_player entity is available.","properties":{"inverse":{"title":"Inverse","description":"If true, the condition passes if killer_player is not available.","type":"boolean"}}}},{"if":{"properties":{"conditions":{"const":"minecraft:location_check"}}},"then":{"description":"Checks if the current location matches.","properties":{"offsetX":{"title":"Offset X","description":"Offsets to location.","type":"integer"},"offsetY":{"title":"Offset Y","description":"Offsets to location.","type":"integer"},"offsetZ":{"title":"Offset Z","description":"Offsets to location.","type":"integer"},"predicate":{"$ref":"#/definitions/tagsCommonToAllLocations","title":"Predicate","description":"Predicate applied to location."}}}},{"if":{"properties":{"conditions":{"const":"minecraft:match_tool"}}},"then":{"description":"Checks tool.","properties":{"predicate":{"$ref":"#/definitions/tagsCommonToAllItems","title":"Predicate","description":"Predicate applied to item."}}}},{"if":{"properties":{"conditions":{"const":"minecraft:random_chance"}}},"then":{"description":"Test if a random number 0.0–1.0 is less than a specified value.","properties":{"chance":{"title":"Chance","description":"Success rate.","type":"number","minimum":0,"maximum":1}}}},{"if":{"properties":{"conditions":{"const":"minecraft:random_chance_with_looting"}}},"then":{"description":"Test if a random number 0.0–1.0 is less than a specified value, affected by the level of Looting on the killer entity.","properties":{"chance":{"title":"Chance","description":"Base success rate.","type":"number"},"looting_multiplier":{"title":"Looting Multiplier","description":"Looting adjustment to the base success rate. Formula is chance + (looting_level * looting_multiplier).","type":"number"}}}},{"if":{"properties":{"conditions":{"const":"minecraft:reference"}}},"then":{"description":"Test if another referred condition (predicate) passes.","properties":{"name":{"title":"Name","description":"The namespaced ID of the condition (predicate) referred to. A cyclic reference causes a parsing failure.","type":"string"}}}},{"if":{"properties":{"conditions":{"const":"minecraft:survives_explosion"}}},"then":{"description":"Returns true with 1/explosion radius probability."}},{"if":{"properties":{"conditions":{"const":"minecraft:table_bonus"}}},"then":{"description":"Passes with probability picked from table, indexed by enchantment level.","properties":{"enchantment":{"title":"Enchantment","description":"Id of enchantment.","type":"integer"},"chances":{"title":"Chances","description":"List of probabilities for enchantment level, indexed from 0.","type":"array"}}}},{"if":{"properties":{"conditions":{"const":"minecraft:time_check"}}},"then":{"description":"Checks the current time.","properties":{"value":{"$ref":"#/definitions/integerRange","title":"Value","description":"The time value in ticks.","type":["integer","object"]},"period":{"title":"Period","description":"Time gets modulo-divided by this value (for example, if set to 24000, value operates on a time period of daytime ticks just like /time query daytime).","type":"integer"}}}},{"if":{"properties":{"conditions":{"const":"minecraft:weather_check"}}},"then":{"description":"Checks for a current weather state.","properties":{"raining":{"title":"Raining","description":"If true, the condition evaluates to true only if it's raining or thundering.","type":"boolean"},"thundering":{"title":"Thundering","description":"If true, the condition evaluates to true only if it's thundering.","type":"boolean"}}}},{"if":{"properties":{"conditions":{"const":"minecraft:value_check"}}},"then":{"description":"Checks for range of value.","properties":{"value":{"$ref":"#/definitions/numberProvider","title":"Value","description":"The value to test.","type":["integer","object"]},"range":{"$ref":"#/definitions/integerRange","title":"Range","description":"If true, the condition evaluates to true only if it's thundering.","type":["integer","object"]}}}}],"definitions":{"numberRange":{"type":"object","properties":{"max":{"title":"Max","description":"The max value.","type":"number"},"min":{"title":"Minimum","description":"The minimum value.","type":"number"}}},"integerRange":{"properties":{"max":{"$ref":"#/definitions/numberProvider","title":"Max","description":"The max value.","type":["integer","object"]},"min":{"$ref":"#/definitions/numberProvider","title":"Minimum","description":"The minimum value.","type":["integer","object"]}}},"numberProvider":{"$comment":"https://minecraft.wiki/w/Loot_table#Number_Providers","properties":{"type":{"title":"Type","description":"The number provider type.","type":"string","enum":["minecraft:constant","minecraft:uniform","minecraft:binomial","minecraft:score"]}},"allOf":[{"if":{"properties":{"type":{"const":"minecraft:constant"}}},"then":{"description":"A constant value.","properties":{"value":{"title":"Value","description":"The exact value.","type":"number"}}}},{"if":{"properties":{"type":{"const":"minecraft:uniform"}}},"then":{"description":"A random number following a uniform distribution between two values (inclusive).","properties":{"min":{"$ref":"#/definitions/numberProvider","title":"Minimum","description":"The minimum value.","type":["number","object"]},"max":{"$ref":"#/definitions/numberProvider","title":"Max","description":"The maximum value.","type":["number","object"]}}}},{"if":{"properties":{"type":{"const":"minecraft:binomial"}}},"then":{"description":"A random number following a binomial distribution.","properties":{"n":{"$ref":"#/definitions/numberProvider","title":"n","description":"The amount of trials.","type":["integer","object"]},"p":{"$ref":"#/definitions/numberProvider","title":"p","description":"The probability of success on an individual trial."}}}},{"if":{"properties":{"type":{"const":"minecraft:score"}}},"then":{"description":"A scoreboard value.","properties":{"target":{"title":"Target","description":"Scoreboard name provider.","type":["string","object"],"enum":["this","killer","direct_killer","player_killer"],"properties":{"type":{"title":"Type","description":"Resource location.","type":"string","enum":["fixed","context"]}},"allOf":[{"if":{"properties":{"type":{"const":"fixed"}}},"then":{"properties":{"name":{"title":"Name","description":"A UUID or player name.","type":"string"}}}},{"if":{"properties":{"type":{"const":"context"}}},"then":{"properties":{"target":{"title":"Target","type":"string","enum":["this","killer","direct_killer","player_killer"]}}}}]},"score":{"title":"Score","description":"The scoreboard objective.","type":"string"},"scale":{"title":"Scale","description":"Scale to multiply the score before returning it.","type":"number"}}}}]},"enchantments":{"type":"array","items":{"title":"Enchantment","type":"object","properties":{"enchantment":{"title":"Enchantment","description":"An enchantment ID.","type":"string"},"levels":{"$ref":"#/definitions/integerRange","title":"Levels","description":"The level of the enchantment.","type":["integer","object"]}}}},"tagsCommonToAllDamageTypes":{"type":"object","properties":{"bypasses_armor":{"title":"Bypasses Armor","description":"Checks if the damage bypassed the armor of the player (suffocation damage predominantly).","type":"boolean"},"bypasses_invulnerability":{"title":"Bypasses Invulnerability","description":"Checks if the damage bypassed the invulnerability status of the player (void or /kill damage).","type":"boolean"},"bypasses_magic":{"title":"Bypasses Magic","description":"Checks if the damage was caused by starvation.","type":"boolean"},"direct_entity":{"title":"Direct Entity","description":"The entity that was the direct cause of the damage.","type":"object"},"is_explosion":{"title":"Is Explosion","description":"Checks if the damage originated from an explosion.","type":"boolean"},"is_fire":{"title":"Is Fire","description":"Checks if the damage originated from fire.","type":"boolean"},"is_magic":{"title":"Is Magic","description":"Checks if the damage originated from magic.","type":"boolean"},"is_projectile":{"title":"Is Projectile","description":"Checks if the damage originated from a projectile.","type":"boolean"},"is_lightning":{"title":"Is Lightning","description":"Checks if the damage originated from lightning.","type":"boolean"},"source_entity":{"$ref":"#/definitions/tagsCommonToAllEntities","title":"Source Entity","description":"Checks the entity that was the source of the damage (for example: The skeleton that shot the arrow)."}}},"tagsCommonToAllItems":{"type":"object","properties":{"count":{"$ref":"#/definitions/integerRange","title":"Count","description":"The amount of the item.","type":["integer","object"]},"durability":{"$ref":"#/definitions/integerRange","title":"Durability","description":"The durability of the item.","type":["integer","object"]},"enchantments":{"$ref":"#/definitions/enchantments","title":"Enchantments","description":"List of enchantments."},"stored_enchantments":{"$ref":"#/definitions/enchantments","title":"Stored Enchantments","description":"List of stored enchantments."},"items":{"title":"Items","description":"List of item IDs.","type":"array"},"nbt":{"title":"NBT","description":"An NBT string.","type":"string"},"potion":{"title":"Potion","description":"A brewed potion ID.","type":"string"},"tag":{"title":"Tag","description":"An item data pack tag.","type":"string"}}},"tagsCommonToAllLocations":{"type":"object","properties":{"biome":{"title":"Biome","description":"The biome the entity is currently in.","type":"string","enum":["badlands","badlands_plateau","beach","birch_forest","birch_forest_hills","cold_ocean","dark_forest","dark_forest_hills","deep_cold_ocean","deep_frozen_ocean","deep_lukewarm_ocean","deep_ocean","deep_warm_ocean","desert","desert_hills","desert_lakes","end_barrens","end_highlands","end_midlands","eroded_badlands","flower_forest","forest","frozen_ocean","frozen_river","giant_spruce_taiga","giant_spruce_taiga_hills","giant_tree_taiga","giant_tree_taiga_hills","gravelly_mountains","ice_spikes","jungle","jungle_edge","jungle_hills","lukewarm_ocean","modified_badlands_plateau","modified_gravelly_mountains","modified_jungle","modified_jungle_edge","modified_wooded_badlands_plateau","mountain_edge","mountains","mushroom_field_shore","mushroom_fields","nether","ocean","plains","river","savanna","savanna_plateau","shattered_savanna","shattered_savanna_plateau","small_end_islands","snowy_beach","snowy_mountains","snowy_taiga","snowy_taiga_hills","snowy_taiga_mountains","snowy_tundra","stone_shore","sunflower_plains","swamp","swamp_hills","taiga","taiga_hills","taiga_mountains","tall_birch_forest","tall_birch_hills","the_end","the_void","warm_ocean","wooded_badlands_plateau","wooded_hills","wooded_mountains"]},"block":{"title":"Block","description":"The block at the location.","type":"object","properties":{"blocks":{"title":"Blocks","description":"A list of block IDs.","type":"array"},"tag":{"title":"Tag","description":"The block tag.","type":"string"},"nbt":{"title":"NBT","description":"The block NBT.","type":"string"},"state":{"title":"State","description":"A map of block property names to values. Test will fail if the block doesn't match.","type":"object","properties":{"key":{"$ref":"#/definitions/integerRange","title":"Key","description":"Block property key and value pair.","type":["boolean","integer","string","object"]}}}}},"dimension":{"title":"Dimension","description":"The dimension the entity is currently in.","type":"string"},"feature":{"title":"Feature","description":"Name of a structure.","type":"string","enum":["buried_treasure","desert_pyramid","endcity","fortress","igloo","jungle_pyramid","mansion","mineshaft","monument","ocean_ruin","pillager_outpost","shipwreck","stronghold","swamp_hut","village"]},"fluid":{"title":"Fluid","description":"The fluid at the location.","type":"object","properties":{"fluid":{"title":"Fluid","description":"The fluid ID.","type":"string"},"tag":{"title":"Tag","description":"The fluid tag.","type":"string"},"state":{"$ref":"#/definitions/integerRange","title":"State","description":"A map of fluid property names to values. Test will fail if the fluid doesn't match.","type":["boolean","integer","string","object"]}}},"light":{"title":"Light","description":"The light at the location.","type":"object","properties":{"light":{"$ref":"#/definitions/integerRange","title":"Light","description":"The light Level of visible light. Calculated using: (max(sky-darkening,block)).","type":["integer","object"]}}},"position":{"title":"Position","type":"object","properties":{"x":{"$ref":"#/definitions/numberRange","title":"X","description":"The X position."},"y":{"$ref":"#/definitions/numberRange","title":"Y","description":"The Y position."},"z":{"$ref":"#/definitions/numberRange","title":"Z","description":"The Z position."}}},"smokey":{"title":"Smokey","description":"True if the block is closely above a campfire or soul campfire.","type":"boolean"}}},"tagsCommonToAllEntities":{"type":"object","properties":{"distance":{"title":"Distance","type":"object","properties":{"absolute":{"$ref":"#/definitions/numberRange","title":"Absolute"},"horizontal":{"$ref":"#/definitions/numberRange","title":"Horizontal"},"x":{"$ref":"#/definitions/numberRange","title":"X"},"y":{"$ref":"#/definitions/numberRange","title":"Y"},"z":{"$ref":"#/definitions/numberRange","title":"Z"}}},"effects":{"title":"Effects","description":"A map of status effects.","additionalProperties":{"title":"Effect","description":"A status effect with the key name being the status effect name.","type":"object","properties":{"ambient":{"title":"Ambient","description":"Whether the effect is from a beacon.","type":"boolean"},"amplifier":{"$ref":"#/definitions/integerRange","title":"Amplifier","description":"The effect amplifier.","type":["integer","object"]},"duration":{"$ref":"#/definitions/integerRange","title":"Duration","description":"The effect duration in ticks.","type":["integer","object"]},"visible":{"title":"Visible","description":"Whether the effect has visible particles.","type":"boolean"}}}},"equipment":{"title":"Equipment","type":"object","properties":{"mainhand":{"$ref":"#/definitions/tagsCommonToAllItems","title":"Mainhand"},"offhand":{"$ref":"#/definitions/tagsCommonToAllItems","title":"Offhand"},"head":{"$ref":"#/definitions/tagsCommonToAllItems","title":"Head"},"chest":{"$ref":"#/definitions/tagsCommonToAllItems","title":"Chest"},"legs":{"$ref":"#/definitions/tagsCommonToAllItems","title":"Legs"},"feet":{"$ref":"#/definitions/tagsCommonToAllItems","title":"Feet"}}},"flags":{"title":"Flags","description":"Predicate Flags to be checked.","type":"object","properties":{"is_on_fire":{"title":"Is on Fire","description":"Test whether the entity is or is not on fire."},"is_sneaking":{"title":"Is Sneaking","description":"Test whether the entity is or is not sneaking.","type":"boolean"},"is_sprinting":{"title":"Is Sprinting","description":"Test whether the entity is or is not sprinting.","type":"boolean"},"is_swimming":{"title":"Is Swimming","description":"Test whether the entity is or is not swimming.","type":"boolean"},"is_baby":{"title":"Is Baby","description":"Test whether the entity is or is not a baby variant.","type":"boolean"}}},"lightning_bolt":{"title":"Lightning Bolt","description":"Lightning bolt properties to be checked. Fails when entity is not a lightning bolt.","type":"object","properties":{"blocks_set_on_fire":{"title":"Blocks Set on Fire","description":"Number of blocks set on fire by this lightning bolt.","type":"integer"},"entity_struck":{"$ref":"#/definitions/tagsCommonToAllEntities","title":"Entity Struck","description":"Entity properties of entities struck by this lightning bolt. If present, this tag must match one or more entities."}}},"location":{"$ref":"#/definitions/tagsCommonToAllLocations","title":"Location"},"nbt":{"title":"NBT","description":"An NBT string.","type":"string"},"passenger":{"$ref":"#/definitions/tagsCommonToAllEntities","title":"Passenger","description":"The entity directly riding this entity."},"player":{"title":"Player","description":"Player properties to be checked. Fails when entity is not a player.","type":"object","properties":{"looking_at":{"$ref":"#/definitions/tagsCommonToAllEntities","title":"Looking At","description":"The entity that the player is looking at, as long as it is visible and within a radius of 100 blocks."},"advancements":{"title":"Advancements","description":"A map of advancements to check.","type":"object","additionalProperties":{"description":"An advancement ID.","type":["boolean","object"],"additionalProperties":{"type":"boolean"}}},"gamemode":{"title":"Game Mode","description":"The game mode of the player.","type":"string","enum":["survival","adventure","creative","spectator"]},"level":{"$ref":"#/definitions/integerRange","title":"Level","description":"The level of the player.","type":["integer","object"]},"recipes":{"title":"Recipes","description":"A map of recipes to check.","type":"object","additionalProperties":{"type":"boolean"}},"stats":{"title":"Stats","description":"List of statistics to match.","type":"object","additionalProperties":{"type":"object","properties":{"type":{"title":"Type","description":"The statistic base.","type":"string","enum":["minecraft:custom","minecraft:crafted","minecraft:used","minecraft:broken","minecraft:mined","minecraft:killed","minecraft:picked_up","minecraft:dropped","minecraft:killed_by"]},"stat":{"title":"Stat","description":"The statistic ID. Mostly mimics the criteria used for defining scoreboard objectives.","type":"string"},"value":{"$ref":"#/definitions/integerRange","title":"Value","description":"The value of the statistic.","type":["integer","object"]}}}}}},"stepping_on":{"$ref":"#/definitions/tagsCommonToAllLocations","title":"Stepping On","description":"Location predicate for the block the entity is standing on."},"team":{"title":"Team","description":"The team the entity belongs to.","type":"string"},"type":{"title":"Type","description":"An entity ID.","type":"string"},"targeted_entity":{"$ref":"#/definitions/tagsCommonToAllEntities","title":"Targeted Entity","description":"The entity which this entity is targeting for attacks."},"vehicle":{"$ref":"#/definitions/tagsCommonToAllEntities","title":"Vehicle","description":" The vehicle that the entity is riding on."}}}},"description":"Configuration file defining a predicate for a data pack for Minecraft.","properties":{"conditions":{"title":"Conditions","description":"The condition's ID.","type":"string","enum":["minecraft:alternative","minecraft:block_state_property","minecraft:damage_source_properties","minecraft:entity_properties","minecraft:entity_scores","minecraft:inverted","minecraft:killed_by_player","minecraft:location_check","minecraft:match_tool","minecraft:random_chance","minecraft:random_chance_with_looting","minecraft:reference","minecraft:survives_explosion","minecraft:table_bonus","minecraft:time_check","minecraft:weather_check","minecraft:value_check"]}},"title":"Minecraft Data Pack Predicate","type":"object"}