data modify storage jmj:temp offhand set value {id:"air", count:1, components:{}}
data modify storage jmj:temp offhand merge from entity @s Inventory[{Slot:-106b}]
item replace entity @s weapon.offhand with air
data modify storage jmj:temp mainhand set value {id:"air", count:1, components:{}}
data modify storage jmj:temp mainhand merge from entity @s SelectedItem
item replace entity @s weapon.mainhand with air
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,NoBasePlate:1b}
data modify entity @e[type=armor_stand,limit=1,sort=nearest,distance=..0.5] HandItems[0] set from storage jmj:temp offhand
data modify entity @e[type=armor_stand,limit=1,sort=nearest,distance=..0.5] HandItems[1] set from storage jmj:temp mainhand
item replace entity @s weapon.mainhand from entity @e[type=armor_stand,limit=1,sort=nearest,distance=..0.5] weapon.mainhand
item replace entity @s weapon.offhand from entity @e[type=armor_stand,limit=1,sort=nearest,distance=..0.5] weapon.offhand
kill @e[type=armor_stand,limit=1,sort=nearest,distance=..0.5]