clientcommands icon indicating copy to clipboard operation
clientcommands copied to clipboard

Enchantment seed appears to be incorrect

Open PurPur134 opened this issue 2 years ago • 13 comments
trafficstars

After using /ccrackrng, the enchantment seed appears to be incorrect. It thinks I have a different enchantment seed than the one I appear to have. I don't what could be causing this because this is a vanilla multiplayer server and this has worked before and in testing worlds. Here are some screenshots. Notice that the enchantments listed in the top-left are incorrect. 2023-10-02_19 33 18 2023-10-02_19 34 39 2023-10-02_19 34 40 2023-10-02_19 34 41

PurPur134 avatar Oct 07 '23 21:10 PurPur134

If you are suspicious that /ccrackrng is producing the wrong result, you can get your XP seed if you're opped on the server using /data get entity @s XpSeed.

Earthcomputer avatar Oct 07 '23 21:10 Earthcomputer

Unfortunately I'm not opped. Should I try the deprecated enchant cracker and see if that works?

PurPur134 avatar Oct 07 '23 22:10 PurPur134

Can you try it on a server where you are opped?

Earthcomputer avatar Oct 07 '23 22:10 Earthcomputer

I tried it and the enchantments and XpSeed were both wrong.

PurPur134 avatar Oct 08 '23 18:10 PurPur134

Did you test the XpSeed immediately after running /ccrackrng, or after running /enchant as well?

Earthcomputer avatar Oct 08 '23 19:10 Earthcomputer

After running /cenchant and doing a dummy enchantment (the XP seed in the top left only shows after you do that). In the player data it's stored as a decimal, but when converted to hexadecimal it was not the same seed.

PurPur134 avatar Oct 08 '23 19:10 PurPur134

  1. Run /cconfig clientcommands enchantingPredication set true.
  2. Run /ccrackrng
  3. Do an enchantment

It should show now, and should be the same if all goes well. I am trying to determine if the bug is with /cenchant.

Earthcomputer avatar Oct 08 '23 19:10 Earthcomputer

Yes, it worked, thanks! The XP seed is shown in the top-left and is the same as in the player data. I have no idea what could be causing this though.

PurPur134 avatar Oct 09 '23 16:10 PurPur134

Okay so that means bug is with /cenchant. It must be somehow throwing the wrong number of items, or else mispredicting how many random calls it would take. It's a bit tedious, but can you try to throw the items manually instead? You can use /cenchant --simulate to show how many items you need to throw without automatically throwing them.

Earthcomputer avatar Oct 09 '23 16:10 Earthcomputer

Note that when throwing items manually, you must throw each item individually, you cannot throw out a stack at a time, that doesn't work.

Earthcomputer avatar Oct 09 '23 16:10 Earthcomputer

Throwing the items manually did work and gave the correct enchantments. Also, could you explain how /cenchant works? I don't get how throwing items would affect the enchantment seed.

PurPur134 avatar Oct 10 '23 00:10 PurPur134

Hello, any updates on this?

PurPur134 avatar Oct 12 '23 00:10 PurPur134

I haven't looked into fixing it yet. Throwing items changes the player RNG, which is also used to generate the XP seed. It doesn't affect the current XP seed, only from the next one that is generated, which is why you typically need to do a dummy enchant.

Earthcomputer avatar Oct 12 '23 23:10 Earthcomputer

Hi there, sorry for the delay. I believe I have fixed this in https://github.com/Earthcomputer/clientcommands/commit/e7b9ec1fe526571d026603fac29894ed138cfab1. Could you try out the new build and let me know if it works?

Earthcomputer avatar Mar 03 '24 19:03 Earthcomputer

Going to assume it's fixed. We can always reopen later if it's not.

Earthcomputer avatar Mar 07 '24 20:03 Earthcomputer