Onions can be put in a large trough to breed livestock. Pigs and sheep consider carrots a treat.[1]
assets\survival\blocktypes\wood\trough-large.json