A search for new resonances decaying into a pair of jets is reported using the dataset of proton-proton collisions recorded at s = 13 TeV with the ATLAS detector at the Large Hadron Collider between 2015 and 2018, corresponding to an integrated luminosity of 139 fb(-1). The distribution of the invariant mass of the two leading jets is examined for local excesses above a data-derived estimate of the Standard Model background. In addition to an inclusive dijet search, events with jets identified as containing b-hadrons are examined specifically. No significant excess of events above the smoothly falling background spectra is observed. The results are used to set cross-section upper limits at 95% confidence level on a range of new physics scenarios. Model-independent limits on Gaussian-shaped signals are also reported. The analysis looking at jets containing b-hadrons benefits from improvements in the jet flavour identification at high transverse momentum, which increases its sensitivity relative to the previous analysis beyond that expected from the higher integrated luminosity.