Currently common-pool resource systems world-wide are under pressure due to overexploitation and environmental change. To ensure that these systems continue to provide vital ecosystem services it is necessary to sustain or increase their resilience against such pressure. One way of doing this may be to improve cooperation among agents who are heavily involved in common-pool resource systems, such as farmers, fishers, managers, and companies. Historical examples suggest that the persistence or collapse of common-pool resource systems may hinge on agents collaborating or not, but cooperation as a mechanism to improve resilience is not commonly included in existing models for studying resilience. Cooperation may be sustained through indirect reciprocity, i.e., cooperative behaviour by one agent that may be repaid by other agents. In this paper we develop a suite of agent-based models that represent an abstract version of a generic spatial common-pool resource system. This suite of models contains various mechanisms for cooperation based on trust. We investigate how the resilience of the models is affected by these mechanisms. The resilience of the models is assessed by applying various shocks which make it more difficult to gather resource, and measuring whether and how fast the agent population can recover from these shocks. The results suggest that although indirect reciprocity positively affects the level of cooperation in the system, cooperation could be common even without indirect reciprocity. It is shown that the presence of cooperation increases the resilience of the models against shocks.