Minecraft wiki entry for Command_blocks_and_functions, associated text: The previous is often used in conjunction with buttons. Sometimes however, there might not be enough room to hide a command block. In that case, the player can use a repeating command block to test if a button on (x, y, z) is pressed.