How do I create flint and steel that only is usable on obsidian?

I have seen this done in many other adventure maps. Does anyone have any ideas? I need a flint and steel that can only be used on obsidian.


The player will need to be in adventure mode (/gamemode adventure @a). Then, you can control what blocks the flint and steel can be used on with the CanPlaceOn list.

1.12-:

/give @a flint_and_steel 1 0 {CanPlaceOn:["minecraft:obsidian"]}

1.13+:

/give @a flint_and_steel{CanPlaceOn:["minecraft:obsidian"]}