-
Notifications
You must be signed in to change notification settings - Fork 4
Client Trim Overlay
To allow tools to show trims or modify which trim a tool receives, create a client trim overlay at assets/<namespace>/overlay/trim_material/<path>.json and its associated textures. At runtime, the item model will be combined with the specified trim model.
For example, Bob's Mod adds a new scythe weapon.
assets/bobsmod/tooltrims/trim_overlay/scythe.json
For each use of the tooltrims:trims model and supported trim pattern, you must include a texture <base_path>_<pattern.suffix>. For example, to support the base mod's patterns, this will require the follow textures to be present:
bobsmod:trims/items/scythe_linearbobsmod:trims/items/scythe_tracksbobsmod:trims/items/scythe_chargebobsmod:trims/items/scythe_frost
Mods/datapacks/resourcepacks separately adding client trim materials and client trim overlays will automatically be compatible with each other and display correctly.
See the source code for more examples.
{ // Items this overlay should apply to "items": [ "bobsmod:wooden_scythe", "bobsmod:copper_scythe", "bobsmod:iron_scythe", "bobsmod:golden_scythe", "bobsmod:diamond_scythe", "bobsmod:netherite_scythe" ], // Item model definition/client item for just the trim part of the texture // Can use the normal minecraft:select, minecraft:range_dispatch, etc. // See https://minecraft.wiki/w/Items_model_definition for more info "model": { // tooltrims:trims is a special item model type that only works in trim overlays. // It will generate `minecraft:select` cases for every material & pattern found. "type": "tooltrims:trims", // Item model parent "parent": "minecraft:item/handheld", // Texture key to apply the paletted trim texture to. Optional, defaults to `layer0`. "texture_key": "layer0", // Base path of the trim textures, combined with pattern suffix (see below) "base_path": "bobsmod:trims/items/scythe" } }