Cocoa beans come from cocoa pods, which are found naturally in jungle biomes. Placing a cocoa bean on the side of jungle wood will plant a new cocoa pod. (The log does not need to be attached to a tree).