Minecraft wiki entry for Survival_in_an_infinite_desert, associated text: An alternative tactic is to trap the illagers rather than kill them. This might (needs testing) prevent further Illager spawns, and thus would allow you to collect the wood without being attacked.