Let villagers take jobs and trade

Villagers claim the nearest free job site within 48 blocks and take its
profession, lose a fresh profession when the site goes, flee zombies and
raiders, and shake their heads when they have nothing to sell.
Right-clicking a villager or wandering trader opens its trades; offers,
experience, level, profession and job site are saved as vanilla NBT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-09 11:04:32 +02:00
parent 07e36a90d3
commit 2b664b4c4e
10 changed files with 568 additions and 14 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ pub fn sheep_wool_rgb(color: u8) -> u32 {
let f = |c: u32| ((c as f32 * 0.75).floor() as u32).min(255);
f(src >> 16 & 255) << 16 | f(src >> 8 & 255) << 8 | f(src & 255)
}
const VILLAGER_TYPES: [&str; 7] = [
pub const VILLAGER_TYPES: [&str; 7] = [
"plains", "desert", "jungle", "savanna", "snow", "swamp", "taiga",
];
pub const PROFESSIONS: [&str; 15] = [