I programmed a command block to remove an item, and then hooked it up to a redstone clock. I then tried to test it by setting the item it removed to data value 271, or a wood axe. When I activated it, it removed all the wood axes from my inventory, but when I went into my creative inventory to grab redstone, it was removed immediately. I switched to survival mode, and it allowed me to grab things from my inventory again. But when I switched back to creative, it continued. The effect ended when I shut off the machine.