Give an item with following command:
/give @s minecraft:bow[minecraft:custom_data={'xclib:run_command':{inventory_change:{enable:true,command:"say 3"}}}]
and it triggered the advancement as well as you move it in player inventory. But when you throw it out, there will be no title and sound output.
Give an item with following command:
and it triggered the advancement as well as you move it in player inventory. But when you throw it out, there will be no title and sound output.