/customModelData
This is a simple command to allow you to simply swap out the custom model data on an item.
/customModelData <block/entity> <pos|target> <slot> [set|reset] <value>
Syntax:
Block / Entity
This works on all types of entities, as well as storage blocks
Block: A storage-type block, such as a Chest, Barrel, or Lectern.
​
Entity: A target selector, this works on all entities
Pos / Target
This is the specific coord or target of which block/entity you want to edit the info of
Pos: ~ ~ ~ coords that mark a storage block
​
Entity: Target selector for which entities item you want to edit
Slot
This is the slot of the item you want to edit
Set / Reset
This lets you assign or remove the custommodeldata value
Enter in the number of the customModelData value at the end of this command.
/customModelData block -1350 63 751 container.0 set 20
/customModelData entity @s weapon.mainhand set 5
/customModelData entity @a weapon.offhand reset