Do iron farms work in skyblocks?


Listening to music
I just want to know before I use all the iron for an anvil (for a name tag). I got a zombie right up to the villagers and they weren't bothered at all. Does the zombie need to hurt the villager first or do they just not get scared in skyblocks?