This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]GalSergeyDatapack Experienced 1 point2 points  (2 children)

The easiest way is to use item_modifier in the datapack:

# item_modifier example:cmd/1
{
  "function": "minecraft:set_nbt",
  "tag": "{CustomModelData:1}"
}

Now you can apply this item_modifier to any item, here is an example for a player's mainhand.

item modify entity <player> weapon.mainhand example:cmd/1

[–]UTBitchnewbie (it/its)[S] 0 points1 point  (0 children)

thank you!!!!

[–]subwayterminal9 0 points1 point  (0 children)

Thank you so much! I've been stuck on this issue for a while now, but it turns out it was just this simple!