Custom Data Output:
Repeater:
execute as `PLAYER` if data entity @s SelectedItem.components."minecraft:custom_data".cmd run setblock ~1 ~ ~ command_block{TrackOutput:0b}
Chain 1: execute as `PLAYER` if data entity @s SelectedItem.components."minecraft:custom_data".cmd run data modify block ~1 ~ ~-1 Command set from entity @s SelectedItem.components."minecraft:custom_data".cmd
Chain 2: setblock ~1 ~ ~-1 minecraft:redstone_block
Chain 3: setblock ~1 ~1 ~-2 minecraft:redstone_block
Top Left: execute as `PLAYER` unless data entity @s SelectedItem.components."minecraft:custom_data".cmd run setblock ~3 ~ ~ air
Top Right:
/kill @e[type=item,nbt={Item:{id:"minecraft:activator_rail"}},distance=..5]
Bot Left: execute as `PLAYER` unless data entity @s SelectedItem.components."minecraft:custom_data".cmd run setblock ~3 ~ ~ air
Bot Right: execute as `PLAYER` unless data entity @s SelectedItem.components."minecraft:custom_data".cmd run setblock ~3 ~ ~ air