Fix villager suppot
See original GitHub issueVersions
- mineflayer: 2.12.0
- server: LAN 1.8.8
- node: v13.3.0
Detailed description of a problem
At first when I try to use bot.openVillager(villagerEntity)
I get this error:
(node:10190) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
120 !== undefined
at Bot.openVillager (/dir/node_modules/mineflayer/lib/plugins/villager.js:56:12)
Which is easy to solve (villager in 1.8 has a capital letter), but lets just comment that assert for simplicity. The problem comes when I try to run the code without that assert and I get this error:
/dir/node_modules/minecraft-protocol/src/transforms/framing.js:67
} else { throw e }
^
Error: Read error for trades.3.firstInput.unknown.true.nbtData.type : 18 is not in the mappings value
at ProtoDef.readMapper (/dir/node_modules/protodef/src/datatypes/utils.js:30:34)
at ProtoDef.read (/dir/node_modules/protodef/src/protodef.js:36:25)
at ProtoDef.read (/dir/node_modules/protodef/src/protodef.js:110:29)
at /dir/node_modules/protodef/src/datatypes/structures.js:45:32
at tryCatch (/dir/node_modules/protodef/src/utils.js:50:16)
at tryDoc (/dir/node_modules/protodef/src/utils.js:54:10)
at /dir/node_modules/protodef/src/datatypes/structures.js:44:5
at Array.forEach (<anonymous>)
at ProtoDef.readContainer (/dir/node_modules/protodef/src/datatypes/structures.js:43:12)
at ProtoDef.read (/dir/node_modules/protodef/src/protodef.js:36:25) {
field: 'trades.3.firstInput.unknown.true.nbtData.type'
}
I guess some changes broke backwards compatibility with 1.8 villagers.
Current code
let villager = bot.openVillager(villagerEntity)
Expected behavior
Shouldn’t throw error
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Fixing Villager Trades & Ending Villager Exploitation for real ...
Strictly for humanoid and humanoid type mobs feedback and suggestions. Bugs, duplicate ideas, lists of things, and support issues will be ...
Read more >Forge's Villager Trade Fix Mod? : r/feedthebeast - Reddit
I know that Fabric & Spigots has a trade fix mod to make Villager trades not broken anymore. But what about Forge?
Read more >Villager Job Fix [DATA PACK] - Customization - CurseForge
Villager Job Fix [DATA PACK] ... Fix restocking issues;; Visually displays villagers that were able or unable to ... Support for my Data...
Read more >Village mechanics - Minecraft Wiki - Fandom
Population of a village is never measured. Villager breeding succeeds if the birthing parent can path to an unclaimed bed with at least...
Read more >Guide for Virtual Villagers Origins 2 - Story walkthrough
At Construction Level 2, you can also have your builders repair the Stone Hut at the top right of the map, closest to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ok got it,the openVillager callback was called wrong, fixed and released as 2.14.1
and why is village instance printed, is that related ?