Java 26.2
/data merge entity
@e[type=minecraft:zombie,limit=1]/data merge entity
Merge SNBT into one entity.
/data merge entity @e[type=zombie,limit=1] {CustomName:'{"text":"NBTForge"}'}Merge entity NBT
Summoning an entity again resets it. /data merge edits the one that is already there, which is what you want for a boss mid-fight or an armor stand you have already positioned. Compose the NBT payload here and target the entity precisely.
Summoning a fresh entity resets it. /data merge entity edits the one already in the world -- a boss mid-fight, an armor stand you have positioned -- so its state and location stay put while you change name, health, tags or attributes.
Use a precise selector: @e[type=...,limit=1,sort=nearest] or a named tag. /data merge entity applies to every entity the selector matches, so an unbounded selector can edit more than you intend.
Yes -- /data get entity <selector> <path> returns a value, and /data merge writes one. This tool builds the merge (write) form; use /data get for inspection.
Java 26.2
@e[type=minecraft:zombie,limit=1]Merge SNBT into one entity.
/data merge entity @e[type=zombie,limit=1] {CustomName:'{"text":"NBTForge"}'}