  Metallicity is a fundamental physical property that strongly constrains
galaxy formation and evolution. The formation of stars in galaxies is
suppressed by the energy released from supernova explosions and can be enhanced
by metal production. In order to understand the impact of this supernova
feedback, we compare four different feedback methods, ejecting energy in
thermal, kinetic, stochastic and mechanical forms, into our self-consistent
cosmological chemodynamical simulations. To minimise other uncertainties, we
use the latest nucleosynthesis yields that can reproduce the observed elemental
abundances of stars in the Milky Way. For each method, we predict the evolution
of stellar and gas-phase metallicities as a function of galaxy mass, i.e., the
mass-metallicity relations. We then find that the mechanical feedback can give
the best match to a number of observations up to redshift $z\sim3$, although
the predicted gas-phase metallicities seem to be higher than observed at $z\ge
1$. The feedback modelling can be further constrained by the metallicities in
distant galaxies with the James Web Space Telescope and those of a large sample
with ongoing and future spectroscopic surveys.
