This question already has an answer here:
I made myself a nice artificial village, however I severely underestimated the number of villagers it would create:
I now have a couple hundred villagers all crammed in this tiny spot here, and as you can see with the hearts, they aren't showing any signs of stopping.
This isn't a bad thing, as I am after that one villager who sells me the coveted 'Mending' enchanted book. There's just one problem: all these other villagers that get in my way and have relatively worthless trades.
For these "lesser" individuals, I could just slay them with my sword, but there are several iron golems who ruthlessly seek revenge as soon as I touch any of them. Turns out not everyone shares my vision of a perfect world with perfect trades.
I could also let them free, but that would be disastrous: I'd never get them back into my
jail custom-built house. It'd be like herding cats. And I don't know if you've ever had a villager stuck inside rows of doors, but they open and close them incessantly.
Here's what I'd like to do:
- I do not want to accidentally kill any child villagers for any reason, because I want to see their trades once they become adults
- I do want to kill any villagers with worthless trades at my discretion.
- I do not want to aggro Iron Golems in any way, because I value my life
- I do not want to kill Librarians until after I've traded with them enough to see what their second enchanted book is. I also want to keep Farmers, as they are my primary income for emeralds.
- I am in Survival on Bedrock Edition, so command blocks, cheats, and anything in Creative Mode are off the table.
How can I safely cull villagers who don't offer meaningful trades while preserving those villagers that do?