Pineapples are a renewable resource, and essential in the crafting of Piña Coladas. Farming Pineapples is possible by breaking only the top of it, leaving the other half to grow. Pineapples can be replanted by right clicking on ground.
You can craft Pineapple Cubes that restore 1 hunger by placing a Pineapple in a crafting area. They spawn in forests/grasslands