-
Notifications
You must be signed in to change notification settings - Fork 8
Item Modifiers
With these files you'll be ableto modify some visual property of an Item. These include:
- Item Rarity
- Tooltips
- Durability Bar Color
- Item Tint
- Custom Item Moedels
To start you'll do exactly what you did with Block Properties Modifiers.
Here too you'll need a .json
and or a .png
file in the /item_modifiers
subfolder.
(If only a png is added this will be assigned to the Item Tint property)
First you'll need to create a .json
file in your resource pack folder in assets/[item namespace]/polytone/item_modifiers/[item name].json
.
Say for example the block you want to edit is supplementaries:quiver
, then the file will be assets/supplementaries/polytone/item_modifiers/quiver.json
Alternatively, if you want to manually specify your targets items or need to target more than one, you can place this json in assets/[your pack namespace]/polytone/item_modifiers/[some name].json
(Any path will work but this is recommended to avoid overwriting Implicit defined targets).
Useful if you want yo modify more than 1 target for the same json.
Then you can add the targets
field containing a list of valid item ids to the json as follows:
{
"targets": ["minecraft:emerald", "minecraft:iron_ingot"]
}
Once you have your Item Modifier json file you can add many attributes to it.
parameter | explanation |
---|---|
colormap |
A Colormap to be used for item model tint. Needs a model with tint_index
|
bar_color |
A Colormap to be used for item durability bar color |
rarity |
Rairty of the item. Can be common , uncommon , rare , epic
|
tooltips |
A list of Components to be added to tooltips |
removed_tooltips |
A list of Regex Strings that will be used to figure out which components to remove |
custom_models |
A list of Custom Item Models. Check out the related wiki page for more info |
As usual all parameters are optional.
Here's an example:
{
"colormap": "foliage_color",
"bar_color": "damage",
"rarity": "epic",
"tooltips": [
{
"italic": true,
"color": "green",
"text": "Some Text"
}
],
"remove_tooltips": [
"minecraft\\:"
]
}
In this example we are giving that item tint the existing foliage_color
colormap.
As for the bar_color
we are creating a new Colormap
with the builit-in type of damage
(see Colormaps section) which will sample a colormap texture exactly in the same way that normal durability color does, so from 0 at no damage to 1 at max damage.
For tooltips we are adding a simple tooltip line and removing all the ones that contain the keyword "minecraft:"
When adding Tint or Bar Colormaps you can, as usual, reference existing previously defined Colormaps like in the example above.
If you want, as in other places, you can also inline a colormap definition (read about them in their own as well as the Block Modifiers pages).
When inlining, similarly to what was done in block modifiers, you'll have to place a texture file in the same path as the .json file.
Its name will have to be [json_name].png
and or [json_name]_bar.png
, depending on the colormaps that you added. When just adding one of the two, adding a single texture called [json_name].png
will aslo work.
Also note that if you DONT add a json at all and just add a .png texture, like in Block and Fluid Modifiers, a modifier will be implicitly created using the default colormap type. Caveat is that in this case instead of biome_sample
like it was used for blocks, the damage
type will be used for the bar_colormap
field (same behavior as vanilla durability bar, read about it on the Colormaps section)