Skip to content

Model Predicates

SuperMartijn624 edited this page Jul 2, 2026 · 2 revisions

Model Predicates

Model predicates are conditions that can be used in various model contexts, such as item/block model modifiers and composite models.

There are 6 general model predicates, 10 block model predicates, and 10 item model predicates.

General model predicates

Fusion provides the following 6 general model predicates:

  • block_and_item: true only if the block predicate is true in a block context, true only if the item predicate is true in an item context
    • block: a block model predicate
    • item: an item model predicate
  • and: true if all specified predicates are true
    • predicates: predicates that all need to be satisfied
  • or: true if at least one of the specified predicates is true
    • predicates: predicates of which one needs to be satisfied
  • not: true if the given predicate is not true
    • predicate: predicate of which the inverse will be taken
  • true: always true
  • false: always false

Block and item model predicates can also be used as general model predicates.
For block model predicates in an item context, the block is obtained from the item if possible and evaluated as if in an empty world.
For item model predicates in a block context, a stack is created from the block's item.

Examples of general model predicates

block_and_item

Evaluates to true when the block is in a desert in a block context and to true when the number of items in the stack is greater than 10 in an item context.

{
  "type": "block_and_item",
  "block": {
    "type": "biome",
    "biome": "desert"
  },
  "item": {
    "type": "count",
    "min": 10
  }
}

and

Evaluates to true when the item contains the Night Vision potion effect and the number of items in the stack is greater than 10.

{
  "type": "and",
  "predicates": [
    {
      "type": "potion",
      "potion": "night_vision"
    },
    {
      "type": "count",
      "min": 10
    }
  ]
}

or

Evaluates to true when the item has full durability or the block is gravel.

{
  "type": "or",
  "predicates": [
    {
      "type": "durability",
      "min_percentage": 1
    },
    {
      "type": "match_block",
      "block": "gravel"
    }
  ]
}

not

Evaluates to true when the block is not sand.

{
  "type": "not",
  "predicate": {
    "type": "match_block",
    "block": "sand"
  }
}

Block model predicates

There are 10 block model predicates:

  • altitude: true if the block is between the specified y-values
    • min_height: y-value that the block needs to be at or above
    • max_height: y-value that the block needs to be at or below
  • biome: true if the block is in one of the specified biomes
    • biome/biomes: a biome or array of biomes that should be matched
    • ignore_missing: boolean, when true any missing biomes will be ignored, useful for modded biomes which may not always be present
  • dimension: true if the block is in one of the specified dimensions
    • dimension/dimensions: a dimension or array of dimensions that should be matched
    • ignore_missing: boolean, when true any missing dimension will be ignored, useful for modded dimensions which may not always be present
  • match_block: true if the block at one of the specified offsets matches one of the specified blocks
    • offset/offsets: array of 3 integers or array of arrays of 3 integers, >=-1 <=1, corresponding to the offsets that should be checked
    • block/blocks: a block or array of blocks that should be matched
    • ignore_missing: boolean, when true any missing blocks will be ignored, useful for modded blocks which may not always be present
    • apply_model_rotation: boolean, whether to apply model transform to this predicate, true by default
  • match_state:
    • offset/offsets: array of 3 integers or array of arrays of 3 integers, >=-1 <=1, corresponding to the offsets that should be checked
    • block/blocks: a block or array of blocks that should be matched
    • properties: an object where each key is the name of the property and its corresponding value is an array with allowed values for the property
    • ignore_missing: boolean, when true any missing blocks will be ignored, useful for modded blocks which may not always be present
    • apply_model_rotation: boolean, whether to apply model transform to this predicate, true by default
  • and: true if all specified predicates are true
    • predicates: predicates that all need to be satisfied
  • or: true if at least one of the specified predicates is true
    • predicates: predicates of which one needs to be satisfied
  • not: true if the given predicate is not true
    • predicate: predicate of which the inverse will be taken
  • true: always true
  • false: always false
Examples of block model predicates

altitude

Evaluates to true when the block is between y-level 150 and 200.

{
  "type": "altitude",
  "min_height": 150,
  "max_height": 200
}

biome

Evaluates to true when the block is in a jungle biome.

{
  "type": "biome",
  "biome": "jungle"
}

Evaluates to true when the block is in a jungle or desert biome.

{
  "type": "biome",
  "biomes": ["jungle", "desert"]
}

dimension

Evaluates to true when the block is in the end.

{
  "type": "dimension",
  "dimension": "the_end"
}

Evaluates to true when the block is in the end or in the nether.

{
  "type": "dimension",
  "dimension": ["the_end", "the_nether"]
}

match_block

Evaluates to true when the block is an Oak Trapdoor.

{
  "type": "match_block",
  "block": "oak_trapdoor"
}

Evaluates to true when the block above the model is an Oak Trapdoor.

{
  "type": "match_block",
  "offset": [0,1,0],
  "block": "oak_trapdoor"
}

Evaluates to true when there is an Oak Trapdoor or an Acacia Trapdoor above or below the model.

{
  "type": "match_block",
  "offset": [[0,-1,0], [0,1,0]],
  "blocks": ["oak_trapdoor", "acacia_trapdoor"]
}

match_state

Evaluates to true when the block is an Oak Trapdoor that is open.

{
  "type": "match_block",
  "block": "oak_trapdoor",
  "properties": {
    "open": ["true"]
  }
}

Evaluates to true when the block above the model is an Oak Trapdoor that is open.

{
  "type": "match_block",
  "offset": [0,1,0],
  "block": "oak_trapdoor",
  "properties": {
    "open": ["true"]
  }
}

Evaluates to true when there is an Oak Trapdoor or an Acacia Trapdoor that is open above or below the model.

{
  "type": "match_block",
  "offset": [[0,-1,0], [0,1,0]],
  "blocks": ["oak_trapdoor", "acacia_trapdoor"],
  "properties": {
    "open": ["true"]
  }
}

and

Evaluates to true when the model is above y-level 120 and the block above the model is Snow.

{
  "type": "and",
  "predicates": [
    {
      "type": "altitude",
      "min_height": 120
    },
    {
      "type": "match_block",
      "offset": [0,1,0],
      "block": "snow"
    }
  ]
}

or

Evaluates to true when the model is above y-level 120 or the block above the model is Snow.

{
  "type": "and",
  "predicates": [
    {
      "type": "altitude",
      "min_height": 120
    },
    {
      "type": "match_block",
      "offset": [0,1,0],
      "block": "snow"
    }
  ]
}

not

Evaluates to true when the block below the model is not water.

{
  "type": "not",
  "predicate": {
    "type": "match_block",
    "offset": [0,-1,0],
    "block": "water"
  }
}

Item model predicates

There are 10 item model predicates:

  • count: true if the number of items in the stack is between the specified minimum and maximum
    • min: minimum number of items
    • min_percentage: minimum number of items as a percentage of the maximum stack size, value between 0 and 1
    • max: maximum number of items
    • max_percentage: maximum number of items as a percentage of the maximum stack size, value between 0 and 1
  • durability: true if the remaining durability of the item is between the specified minimum and maximum
    • min: minimum durability value
    • min_percentage: minimum durability value as a percentage of the total durability of the item, value between 0 and 1
    • max: maximum durability value
    • max_percentage: maximum durability as a percentage of the total durability of the item, value between 0 and 1
  • enchantment: true when the item's level of the specified enchantment is between the specified values
    • enchantment: enchantment to be matched
    • min_level: minimum level of the enchantment
    • max_level: maximum level of the enchantment
  • match_custom_name:
    • match_type: how to match the name, one of equals, starts_with, ends_with, contains, regex
    • text: text to match
  • potion: true if the item matches one of the specified potion type
    • potion/potions: type of or array of types of potions that should be matches
  • and: true if all specified predicates are true
    • predicates: predicates that all need to be satisfied
  • or: true if at least one of the specified predicates is true
    • predicates: predicates of which one needs to be satisfied
  • not: true if the given predicate is not true
    • predicate: predicate of which the inverse will be taken
  • true: always true
  • false: always false

Tip

A list of vanilla potion types can be found at the Minecraft wiki.

Tip

For testing regex, you can use RegEx101.

Examples of item model predicates

count

Evaluates to true when the number of items in the stack is greater than 10.

{
  "type": "count",
  "min": 10
}

Evaluates to true when the number of items in the stack is less than 90% of the max stack size.

{
  "type": "count",
  "max_percentage": 0.9
}

Evaluates to true when the number of items in the stack is greater than 10% of the max stack size and less than 20.

{
  "type": "count",
  "min_percentage": 0.1,
  "max": 20
}

durability

Evaluates to true when the remaining durability of the item is greater than 100.

{
  "type": "durability",
  "min": 100
}

Evaluates to true when the remaining durability of the item is less than 90% of the total durability.

{
  "type": "durability",
  "max_percentage": 0.9
}

Evaluates to true when the remaining durability of the item is greater than 20% of the total durability and less than 1000.

{
  "type": "durability",
  "min_percentage": 0.2,
  "max": 1000
}

enchantment

Evaluates to true when the item is enchanted with Efficiency level 2 or higher.

{
  "type": "enchantment",
  "enchantment": "efficiency",
  "min_level": 2
}

Evaluates to true when the item is enchanted with exactly Efficiency level 2.

{
  "type": "enchantment",
  "enchantment": "efficiency",
  "min_level": 2,
  "max_level": 2
}

Evaluates to true when the item is enchanted with Unbreaking level 3 or lower.

{
  "type": "enchantment",
  "enchantment": "unbreaking",
  "max_level": 3
}

match_custom_name

Evaluates to true when the item has a custom name and the name is "Boomerang".

{
  "type": "match_custom_name",
  "text": "Boomerang"
}

Evaluates to true when the item has a custom name and the name starts with "Rare ".

{
  "type": "match_custom_name",
  "match_type": "starts_with",
  "text": "Rare "
}

Evaluates to true when the item has a custom name and the name ends with "Lance".

{
  "type": "match_custom_name",
  "match_type": "ends_with",
  "text": "Lance"
}

Evaluates to true when the item has a custom name and the name contains "Rare".

{
  "type": "match_custom_name",
  "match_type": "contains",
  "text": "Rare"
}

Evaluates to true when the item has a custom name and the name contains a word followed by " Spear".

{
  "type": "match_custom_name",
  "match_type": "regex",
  "text": "[a-zA-z]+ Spear"
}

potion

Evaluates to true when the item contains the Night Vision potion effect.

{
  "type": "potion",
  "potion": "night_vision"
}

Evaluates to true when the item contains the Night Vision or Slowness potion effects.

{
  "type": "potion",
  "potion": ["night_vision", "slowness"]
}

and

Evaluates to true when the item contains the Night Vision potion effect and the number of items in the stack is greater than 10.

{
  "type": "and",
  "predicates": [
    {
      "type": "potion",
      "potion": "night_vision"
    },
    {
      "type": "count",
      "min": 10
    }
  ]
}

or

Evaluates to true when the item has full durability or the number of items in the stack is greater than 2.

{
  "type": "or",
  "predicates": [
    {
      "type": "durability",
      "min_percentage": 1
    },
    {
      "type": "count",
      "min": 2
    }
  ]
}

not

Evaluates to true when the item does not contain the Luck portion effect.

{
  "type": "not",
  "predicate": {
    "type": "potion",
    "potion": "luck"
  }
}

Clone this wiki locally