/data merge <entity|block|storage> <the entity, block or storage> <NBT to merge>
However, using merge will overwrite every other trade the villager has (unless you include all the other trades in your merge command). A better way of doing this is using modify:
/execute as @e[type=villager,tag=Leatherworker] run data modify entity @s Offers.Recipes append value {buy:{id:emerald,Count:1},buyB:{id:rotten_flesh,Count:4},sell:{id:leather,Count:1},maxUses:9999999}
/execute as @e[type=villager,tag=Leatherworker] run data merge entity @s {Offers:{Recipes:[{buy:{id:emerald,Count:1},buyB:{id:rotten_flesh,Count:4},sell:{id:leather,Count:1},maxUses:9999999}]}}
/execute if entity @e[type= minecraft:endermite, tag= freeze, nbt={HurtTime:1s}] run data modify entity @s {Glowing:1b,Invulnerable:1b,NoAI:1b,NoGravity:1b,Silent:1b}
Basically I'm giving leatherworkers the ability to turn rotten flesh into the leather. Here is the trade:
Offers:{Recipes:[{buy:{id:emerald,Count:1},buyB:{id:rotten_flesh,Count:4},sell:{id:leather,Count:1},maxUses:9999999}]}
My problem is that I don't understand the merge command, I'm trying to give the offer above ^^^ to all entities with my custom tag of "Leatherworker"
The syntax is:
However, using merge will overwrite every other trade the villager has (unless you include all the other trades in your merge command). A better way of doing this is using modify:
Command block engineer // Developer // #TeamTrees
If I wanted to write this as a merge command, how would I write it?
Like this:
Command block engineer // Developer // #TeamTrees
It works with villager, but why doesn't it work:
/execute if entity @e[type= minecraft:endermite, tag= freeze, nbt={HurtTime:1s}] run data modify entity @s {Glowing:1b,Invulnerable:1b,NoAI:1b,NoGravity:1b,Silent:1b}