Biodiversity showed positive effects on resistance but mixed effects on resilience to climatic extremes in a long-term grassland experiment.