This repository has been archived by the owner on Mar 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Linguardium edited this page Jul 31, 2020
·
2 revisions
This mod adds an additional override predicate option called nbt
.
These predicates are loaded in FILO, so bottom entries are matched first.
Order of check is NBT then vanilla predicates so if an nbt predicate matches first, it will not check vanilla predicate values.
sample model json:
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "minecraft:item/stone_pickaxe"
},
"overrides": [
{
"nbt": [
{
"eval": "Nbt.Number('Damage') > 1 && Nbt.Number('Damage') < 4"
}
],
"model": "item/fishing_rod"
},
{
"nbt": [
{
"eval": "Nbt.Text('display.Name').contains('BALL')"
}
],
"model": "item/slime_ball"
},
{
"nbt": [
{
"eval": "Nbt.Enchantment('efficiency') > 3"
}
],
"model": "item/diamond_pickaxe"
}
]
}
The following helper functions exist within Nbt:
-
Number(NBT Path)
retrieves a number nbt value as a Long -
Decimal(NBT Path)
retrieves a decimal nbt value as a Double -
String(NBT Path)
retrieves a string nbt value as a String -
Text(NBT Path)
retrieves a Text nbt value such as display.Name as a String -
Count()
retrieves the itemstack count as an Integer -
MainHand()
returns a boolean if the itemstack is identical to the stack in the main hand -
OffHand()
returns a boolean if the itemstack is identical to the stack in the off hand -
Damage()
returns the ItemStack damage value -
MaxDamage()
returns the ItemStack max damage value