A theory of (co)homologies related to set-theoretic n-simplex relations is constructed in analogy with the known quandle and Yang–Baxter (co)homologies, with emphasis made on the tetrahedron case. In particular, this permits us to generalise Hietarinta's idea of “permutation-type” solutions to the quantum (or “tensor”) n-simplex equations. Explicit examples of solutions to the tetrahedron equation involving nontrivial cocycles are presented.