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

auto_lighter not working anymore in 1.21 #405

Open
PlasmaHH opened this issue Aug 18, 2024 · 0 comments
Open

auto_lighter not working anymore in 1.21 #405

PlasmaHH opened this issue Aug 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@PlasmaHH
Copy link

Describe the bug
For a long while now I tried to use auto_lighter again but upon clicking with the torch it vanishes and I get the error:

Tried to load invalid item: 'No key id in MapLike[{Enchantments:[{id:"minecraft:protection",lvl:1s}]}]'

My knowledge of minecraft internals, let alone scarpet are very limited so I have no idea what exactly that means ( I can only guess that at some point the data was required to have an id field and somehow it is missing )

It seems that this is happening from within the __on_player_uses_item function, whose logic I have no idea what it does, I have ever since wondered why the torch for that script is enchanted afterwards...

When printing the item object in that function before editing it says (notice its a stack of 33 there )

[torch, 33, {count:33,id:"minecraft:torch"}]

After editing it says

[torch, 33, {Enchantments:[{id:"minecraft:protection",lvl:1}]}]

so it looks like the id part is gone...

So I tried adding the line

put(item:2:'id','torch')

after the Enchantments part is added, and then it seems to work but I have no idea if thats the right way

Environment

  • Carpet version: 1.4.147
  • Minecraft version: 1.21

roblem here.

@PlasmaHH PlasmaHH added the bug Something isn't working label Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant