[SPIGOT-8018] ItemMeta#setItemModel Does Not Update Armor Textures Created: 15/Mar/25  Updated: 15/Mar/25  Resolved: 15/Mar/25

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Austin Dart Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.21.4, Spigot, bug
Environment:

Java 21; Base spigot-1.21.4.jar from BuildTools


Attachments: PNG File Screenshot 2025-03-15 103715.png     PNG File Screenshot 2025-03-15 103744.png    
Version: 4457-Spigot-73860e0-f0c8dd3
Guidelines Read: Yes

 Description   

When using ItemMeta#setItemModel, it only updates the item's textures and not the armor's textures (if it is armor).

 

For example:

public ItemStack getBaseItem() {
    ItemStack item = new ItemStack(Material.DIAMOND_HELMET);
    ItemMeta meta = item.getItemMeta();
    assert meta != null;
    meta.setItemModel(new NamespacedKey("oni", "oni_1_mask"));
    meta.setUnbreakable(true);
    item.setItemMeta(meta);
    return item;
} 

results in the item being retextured, but not the armor when worn.

 

However, running this command: 

/minecraft:give @s diamond_helmet[item_model="oni:oni_1_helmet",minecraft:equippable={slot:"head"}] 

does retexture both the item and the helmet.

 

I should expect ItemMeta#setItemModel to perform the same thing. I have attached screenshots of both scenarios.



 Comments   
Comment by md_5 [ 15/Mar/25 ]

Your command vs code are using different models (oni:oni_1_mask vs oni:oni_1_helmet).

The items as shown with /data get entity @p Inventory are as expected:

{count: 1, Slot: 0b, components: {"minecraft:item_model": "oni:oni_1_mask", "minecraft:unbreakable": {}}, id: "minecraft:diamond_helmet"},
{count: 1, Slot: 1b, components: {"minecraft:equippable": {slot: "head"}, "minecraft:item_model": "oni:oni_1_helmet"}, id: "minecraft:diamond_helmet"}
Comment by md_5 [ 15/Mar/25 ]

Can you please include a pack which can be used to test?

Generated at Tue Apr 08 03:01:13 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.