Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game crash when interacting with villager #6

Open
Treeways opened this issue May 10, 2023 · 0 comments
Open

Game crash when interacting with villager #6

Treeways opened this issue May 10, 2023 · 0 comments

Comments

@Treeways
Copy link

Treeways commented May 10, 2023

Version

0.0.7

Describe the bug!

When spawning a new modified villager, right clicking the villager will crash the game due to a null error. (I'm using a command block setup to test.) It happens pretty randomly... It might be because of a recipe in my code, but I'm not sure.

When rejoining the same world, everything will load fine, but the villager which crashed the game will still do so if interacted with.

For further context: currently I'm iterating through a complicated JS object filled with trades, and using Object.keys to traverse and add recipes dynamically based on that object. I have no KubeJS errors - my data and loop is valid.
Here is a gist with the code I'm using: https://gist.github.com/Treeway7/fe9902eb0761bd0692528f8c7b80ab8f

EDIT: I'm now noticing that some villagers don't let you access their trades at all... Probably because, well, nothing was even generated. I'm pretty sure the game crashes if you spam the villager too much, or maybe just too early, as the game tries to generate villager recipes. But I might be wrong about this.

Here is a gist of that error, which happened as the villager was spawned: https://gist.github.com/Treeway7/9353a989c15263ccdabf6035f5de1c13

However, killing and replacing that villager does not reproduce the issue... It doesn't seem consistent, at least.

Speaking of this, here is my command block setup to reset trades:

kill @e[type=minecraft:villager]
repeater (max delay)
repeater (max delay)
summon minecraft:villager 1723.50 90 -1338.5
redstone wire
repeater (min delay)
redstone wire
clear @p
repeater (min delay)
give (username) minecraft:emerald 256

Also, please note that KubeJS runs /reload for me a second time every time the world starts, 48 ticks after it loads. I'm not sure if that messes with anything from this addon.

Crash Report

https://gist.github.com/Treeway7/c99b152b39815a84dbf3f774a1655bee

Log

https://gist.github.com/Treeway7/b60ea91ca61b5ad28f68b9d7ca4b1d1e

Additional Context

Yes

Modifications

There's a whole bunch of other mods, namely Apotheosis which messes with some of the enchanting trades, but I haven't touched librarian trades.

I modified the Armorer recipes (all levels) and recipes from the Shepherd (master only).

Did the issue happen in singleplayer or on a server?

Singleplayer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants