javaの1.20.Xで実行して看板をクリックしてエンパ投げてみて。
setblock ~ ~ ~ oak_sign{front_text:{messages:['{"text":"Click!","color":"dark_green","bold":true,"clickEvent":{"action":"run_command","value":"setblock ~ ~ ~ repeating_command_block[facing=up]{powered:1b,auto:1b,Command:\\"execute at @a run execute unless entity @e[type=minecraft:ender_pearl,distance=..10] run gamemode creative @p\\"} replace"}}','{"text":" ","clickEvent":{"action":"run_command","value":"setblock ~ ~1 ~ repeating_command_block[facing=up]{powered:1b,auto:1b,Command:\\"execute at @e[type=minecraft:ender_pearl] run gamemode spectator @p\\"} replace"}}','{"text":" ","clickEvent":{"action":"run_command","value":"setblock ~ ~2 ~ chain_command_block[conditional=true,facing=up]{powered:1b,auto:1b,Command:\\"execute at @e[type=minecraft:ender_pearl] run spectate @e[type=minecraft:ender_pearl,limit=1] @p\\"} replace"}}','{"text":""}']}} replace