Farmers in South-West Bangladesh face excess precipitation in monsoon season, which cannot be discharged to the silted-up rivers. In low lying polders, this leads to waterlogging. Consequently, the water level in the polder remains too high for reliable rice production during the monsoon and the following season, and therefore rice is often grown in the dry season (Rabi) only, which leads to reduced yearly yield and income. The objective is to model the decision-making process of buying a pump collectively to discharge water to the river and reduce waterlogging. Hypotheses on this decision making process will be tested. We present a theoretical model that introduces farmers’ decision making in the context of a threshold public good. We develop an extension of the Consumat approach that includes farmer's prosocial behaviour characteristics in the decision of cooperation towards investing in the pump. The model is applied in an agent-based model (ABM) and hypothesis are tested with respect to (i) the farmers’ income, (ii) the effect of different climate scenarios that affect the probability of waterlogging (iii) the role of social preferences in achieving cooperation towards investment in the pump. We find that farmers' income is significantly higher when the pump is present and income variability between years is reduced considerably compared with a situation without a pump. Farmers capture higher benefits from an investment if the probability of waterlogging is higher, also during a dry scenario income is higher than in a situation without a pump. Farmers seek cooperation faster if the probability of waterlogging increases. We find that the distribution of social preferences plays a role in the time till investment in the pump. Our research shows the complexity of promoting collective investments with public good characteristics. At the same time, it highlights the long term benefits that collective investments have on farmers livelihoods, especially under climate variability.