How do I take minecraft blocks from nowhere?

I was playing minecraft and a player looked at a block and he suddenly had it in his hand. How did he do that? (He was in creative by the way)


The Pick Block key, bound to mouse 3 by default (middle mouse button on most mice.) Just look at the block and press whatever Pick Block is bound to, and it'll be in your hand. Of course, you'll need creative mode.

See also, this Minecraft Wiki article