How can I make a lever disappear after one use?

Solution 1:

Using a command block to break the lever is the simplest solution.

Execute command after lever is pulled:

/setblock <X> <Y> <Z> minecraft:air 0 destroy

The XYZ is the coords of the lever. The "destroy" old block handling makes the command drop the item.

Solution 2:

If you move the block a lever is attached to the lever will break.

Using this you can set up the block the lever is attached to to be movable by a piston. This piston is connected to the lever, so it moves the block once you switch the lever on, therefore breaking the lever.

For example like in the following picture. The lever of course can be on any side of the block it is attached to. A lot more complicated it would be if you want things to be flush with the wall, though...

(In the following picture the piston needs to be a sticky piston.) enter image description here