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 because of "Can't access registry ResourceKey[minecraft:root / minecraft:enchantment]" #1

Open
NuruddinPlays opened this issue Jan 8, 2025 · 3 comments

Comments

@NuruddinPlays
Copy link

NuruddinPlays commented Jan 8, 2025

Not sure whether it is a problem with this mod or just with how I'm doing things, but when I tried to create a new world, and a loot table modifier json file contains the #on_random_loot option for the enchant_with_levels/enchant_randomly functions, the game will crash as soon as the mod tries to load the loot table modifiers

Here's the crash report, debug.log and one of the json files I'm working with
https://gist.github.com/NuruddinPlays/2c30d6a942f32535ded8cee63d8daa25

I have tried both with and without the minecraft: namespace, and the game crashed both times
I have also tried removing the #on_random_loot option from the json files, and the game works fine, but the items won't have any enchantments

@OffsetMonkey538
Copy link
Member

I'll probably take a look at this tomorrow...
Notes for me:
Might be because the registry access in the loot table modifier event from fapi doesnt have access to enchantments? Not sure if the server started event gets fired or if the server starting event gives an instace of the server, but could try storing the server and getting the registry from there? nooo ideaaa

@NuruddinPlays
Copy link
Author

Hey! Any news on this? It's been a week now since I made the report

Also, re: this discord message you sent in the #github channel

oh cool i didnt expect others to use this as well haha

Haha, tbh I was having quite a bit of a hard time with adding the enchanted modded items through the loot table modifier class in 1.21.1 (I had no problems with adding them in 1.20.1), then I saw this mod thinking "Huh, maybe adding it through json would be much, much easier"
Already had all the json files prepared for each of the necessary structures, just need to wait for the fix to be able to fully implement them into my mod (with this mod as a dependency for the time being until I got to figure out how to add them via the modifier class in 1.21.1)

@OffsetMonkey538
Copy link
Member

Oh yeah I'm so sorry, completely forgot about this issue.
again, for me:
use datagen to add similar modifier and see if it works

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

No branches or pull requests

2 participants