  This paper presents a search for new heavy particles decaying into a pair of
top quarks using 139 fb$^{-1}$ of proton--proton collision data recorded at a
centre-of-mass energy of $\sqrt{s}=13$ TeV with the ATLAS detector at the Large
Hadron Collider. The search is performed using events consistent with pair
production of high-transverse-momentum top quarks and their subsequent decays
into the fully hadronic final states. The analysis is optimized for resonances
decaying into a $t\bar{t}$ pair with mass above 1.4 TeV, exploiting a dedicated
multivariate technique with jet substructure to identify hadronically decaying
top quarks using large-radius jets and evaluating the background expectation
from data. No significant deviation from the background prediction is observed.
Limits are set on the production cross-section times branching fraction for the
new $Z'$ boson in a topcolor-assisted-technicolor model. The $Z'$ boson masses
below 3.9 and 4.7 TeV are excluded at 95% confidence level for the decay widths
of 1% and 3%, respectively.
