Minecraft wiki entry for Command_blocks_and_functions, associated text: Through /give @r, one can create a lottery. Keep in mind that now, /give will directly put items into one's inventory, instead of throwing them on the ground in front of the character.