Overrides & Predicates

Overrides is a tag which is only used in item models, which will contain a list of predicate values. These allow different models to be used for certain items under certain situations.

{

“overrides”: [
{“predicate”: { “predicate” : “value_1” }, “model”: “path/my_model_1” },
{“predicate”: { “predicate” : “value_2” }, “model”: “path/my_model_2” }
]
}

You can specify, multiple predicate values at once, with different conditions to be met for the model to be shown.


{“predicate”: { “predicate_1” : “value_1”, predicate_2“value_2” }, “model”: “path/my_model_1” }

There is eleven different predicate values which can be specified, but some of them will only work for certain items, they are:
angle, blocking, brokencast, cooldown, damage, damaged, lefthanded, pull, pulling, time.


Value Order

The order in the list of overrides matters, the smaller decimal values must be at the top starting at 0 increasing in size until the bottom which will end at 1. If the order is changed to have larger decimal values before smaller decimal values some predicate models may not be obtainable and will be overridden by other predicate values.

Fall Through

Overriding models will cause fall through, which means that when a predicate value causes a model to be overwritten, the item will use this model until the next predicate is met, rather than just for each specific predicate value.


Angle

Angle is unique to compasses, and each value corresponds to the angle between the direction the player is facing, on the x axis, and the spawnpoint, moving clockwise from the direction the player is facing. The value specified needs to be between 0 and 1, the value of 1 will be ignored, but the value of 0 will be used when directly looking at the spawnpoint. To calculate the decimal value to use, use (1 / 360) * angle (angle is the angle between the direction the player is facing and the spawnpoint).

{ “predicate”: { “angle”: 0.25 }, “model”: “path/my_model” }

Blocking

Blocking is unique to shields, it can have a value of 0 or 1, which is used as a boolean value, 1 being true ie you are blocking with your shield.

{ “predicate”: { “blocking”: 1 }, “model”: “path/my_model” }

Broken

Broken is unique to elytra, it can have a value of 0 or 1, which is used as a boolean value, 1 being true ie the elytra has broken, which occurs when it runs out of durability, and will no longer work until repaired.

{ “predicate”: { “broken”: 1 }, “model”: “path/my_model” }

Cast

Cast is unique to fishing rods, it can have a value of 0 or 1, which is used as a boolean value, 1 being true, ie you have cast the fishing rod.

{ “predicate”: { “cast”: 1 }, “model”: “path/my_model” }

Cooldown

Cooldown can be used on ender pearls, and chorus fruit, the value corresponds to a decimal value which refers to how long the ender pearl / chorus fruit has left on it’s cooldown, (ender pearls are put on cooldown after you have thrown one, chorus fruit after you have eaten one, the cooldown lasts 1 second).

Due to ender pearls and chorus fruit using the predicate values for how long is left on cooldown the models will be used in the opposite order that they are specified, the model will change to the model at the bottom first working it’s way up to the top.
This also means that fall through will work backwards, the overriding model will be used until the predicate value is reached, then it will move onto the next override

This predicate will not affect the white overlay shown in the inventory when an ender pearl or chorus fruit is used.

overlay

A value of 1 is ignored, but a value of 0 will use this model all the time instead of the ender pearl model as normal.

{ “predicate”: { “cooldown”: 0 }, “model”: “path/my_model_1” },
{ “predicate”: { “cooldown”: 0.2 }, “model”: “path/my_model_2” }

NB my_model_1 will be used constantly for ender pearls, when not on cooldown, in this example

Damage

Damage can be used on any item that has a durability:
axes, hoes, pickaxes, shovels, swords, bows, fishing rods, shears, elytra, carrot on a stick, flint and steel, shields, and any armour piece (only the armour item ie in the inventory, not the armour seen that players are wearing).
Damage can be any decimal value between 0 and 1, 0 will correspond to an item with no damage, and 1 will refer to an item which has 0 durability left, and will break on it’s next use.

{ “predicate”: { “damage”: 0 }, “model”: “path/my_model_1” },
{ “predicate”: { “damage”: 0.333 }, “model”: “path/my_model_2” },
{ “predicate”: { “damage”: 0.667 }, “model”: “path/my_model_3” }

This predicate is often combined with “damaged”: 0, to allow for remodelling unbreakable tools in custom maps. The best way to do this is to use Sparks’ (of accidental games) online damage value generator this will produce all the values for each individual durability value items can have.

{ “predicate”: { “damage”: 0 }, “model”: “path/my_model_1” },
{ “predicate”: { “damage”: 0.333, “damaged”: 0 }, “model”: “path/my_model_2” },
{ “predicate”: { “damage”: 0.667, “damaged”: 0 }, “model”: “path/my_model_3” },
{ “predicate”: { “damaged”: 1 }, “model”: “path/my_model_1” }

NB model_2 and model_3 will only show for unbreakable items

Damaged

Damaged can be used on any item that has a durability (as listed above). It can have a value of 0 or 1, which is used as a boolean value, 1 being true, ie the item has been damaged, it does not matter how much damage the item has taken only that it has lost at least one durability.

{ “predicate”: { “damaged”: 1 }, “model”: “path/my_model” }

Lefthanded

Lefthanded can be used on all items, it can have a value of 0 or 1, which is used as a boolean value, 1 being true, as in the player’s main hand is set to left. This does not affect items in the offhand it will completely change the model if a player’s mainhand is the left hand, this option is set via skin customization in options.

lefthanded 0
“lefthanded”: 0
lefthanded 1
“lefthanded”: 1

{ “predicate”: { “lefthanded”: 1 }, “model”: “path/my_model” }

Pull

Pull is unique to bows, the value can be a decimal anywhere between 0 and 1 inclusive, if the value is set to 0, the model will be used for any bow that is not being pulled back at all, and the value of 1 will be used when the bow is fully pulled back.

{ “predicate”: { “pull”: 0.333 }, “model”: “path/my_model_1” },
{ “predicate”: { “pull”: 0.667 }, “model”: “path/my_model_2” },
{ “predicate”: { “pull”: 1 }, “model”: “path/my_model_3” }

Pulling

Pulling is unique to bows, it can have a value of 0 or 1, which is used as a boolean value, 1 being true ie the bow is being pulled back, to fire an arrow, it does not matter how long the bow has been pulled back for just that it is being pulled back.

{ “predicate”: { “pulling”: 1 }, “model”: “path/my_model” }

Time

Time is unique to clocks, it can have any decimal value between 0 and 1, the value of 1 is ignored, but the value of 0 corresponds to 6000 which is midday in Minecraft.
Getting a specific model for each individual time is not recommended due to the large amount of time values needed. The best method is to get the smallest value from 1 / n, where n is the total number of models you want the clock to have.
Some useful times (predicate value – ingame time (roughly correct)):
“time”: 0 – 6000, “time”: 0.25 – 12785, “time”: 0.5 – 18000, “time”: 0.75 – 23215

{ “predicate”: { “time”: 0 }, “model”: “path/my_model_1” },
{ “predicate”: { “time”: 0.333 }, “model”: “path/my_model_2” },
{ “predicate”: { “time”: 0.667 }, “model”: “path/my_model_3” }