How do I make an item that gives potion effects when held?
For only curtain clocks make you invisible:
Put into an active repeating command block:
/execute as @a[nbt={SelectedItem:{id:"minecraft:clock",Count:1b,tag:{makesYouInvisible:1b}}}] at @s run effect give @s minecraft:invisibility 2 0 true
To give yourself the clock that will make you invisible:
/give @p minecraft:clock{makesYouInvisible:1b} 1
For every clock make you invisible:
Put into an active repeating command block:
/execute as @a[nbt={SelectedItem:{id:"minecraft:clock"}}] at @s run effect give @s minecraft:invisibility 2 0 true