Minecraft wiki entry for Randomizers, associated text: Every time you need to obtain a random bit (0 or 1), you can run the following commands, either manually, via a chain of command blocks, or a function.