Hey all! First big post here in terms of something of this utility-like nature.
Whilst messing around in creative, I was thinking about the Elytra. Fun item. Problem is, flight isn't so free with it, (I thought I heard something about an infinite Elytra item but I can't find it for the life of me. Someone care to remind me about anything like that?) so I devised a little trick to always ensure the player has at least one firework rocket in their inventory, as those can be used to boost the player. This is intended for usage in survival mode, of course, as creative will not spend the rocket.
I'm fairly new to the idea of command blocks, but I think I got this setup made out pretty nicely. I encourage you to point out errors or places to optimize my creation. Best way to fix it is to know what's wrong.
I made an image to show how to do it. Feel free to take it and send it wherever you so please. I don't care what you do with it.
There's some weird stuff going on here (namely with #4 and #5). This is a trick to force the redstone torch to re-fire whenever the state of the scoreboard changes. I'm certain you all can see the commands and what they do, but I'll give it a quick runthrough.
The first block (Red) tests if your score is 2 for the custom board. The following conditional block will test if you have a firework in your inventory (If you do, this releases an output and turns the torch off). The third block (Green highlight) is an impulse block that gives you a firework rocket.
This worked well on its own in terms of simply having the system on, but there was an issue if you turned it off and back on - the torch would always be on at some point, and would never re-fire in the event that you didn't have a rocket. This is where #4 and #5 come in. #4 checks if you set your score to 1 (which is the intended usage from the scoreboard command) which fires a signal to that torch to disable it. It also sends a signal to #5, which increases your score to 2. This disables the output from block #4 (which enables the torch) and enables the output of #1.
It's a really tricky system and I'm sure someone could shorten it. I think this is good for one of my first ever command block systems like this, though.