Skip to content

Fix precision mechanism crafting gametest failing sometimes#10164

Open
JensenJ wants to merge 3 commits intoCreators-of-Create:mc1.21.1/devfrom
JensenJ-Modding:mc1.21.1/precision-mech-test-fix
Open

Fix precision mechanism crafting gametest failing sometimes#10164
JensenJ wants to merge 3 commits intoCreators-of-Create:mc1.21.1/devfrom
JensenJ-Modding:mc1.21.1/precision-mech-test-fix

Conversation

@JensenJ
Copy link
Copy Markdown
Contributor

@JensenJ JensenJ commented Apr 14, 2026

Hi there,

While doing PRs the last few days, I've had a couple of CI builds fail because of the precision mechanism gametest. I had a look into it and discovered that the test would fail if all 16 of the golden sheets in the test were successfully turned into precision mechanisms with no byproducts which is unlikely to happen (2.8% chance I think).

I've done a quick modification to the test which makes the possible results include the mechanism (it was excluded before) and we just pass if any of the results are in the chest. The other way of "fixing" this is to increase the amount of sheets we put through the test, as that would reduce the chance of this happening further. This may be more desirable if you want the test to ensure that the recipe doesn't have a 100% success rate which is probably why it was set up this way (so me removing this may defeat the purpose of the test and thus be an invalid fix). I can change this to put more sheets through if it's preferred, which I imagine it may be; but imo it still doesn't feel like a proper fix as it leaves it to statistics, meaning the issue could happen again.

Ask if you want anything changed or you have any questions. Also, let me know if this is not the correct way to address this issue; as I've typed this I've kinda convinced myself it's not the right way to fix it, but I'll leave it up to you.

I've now changed this; I've modified the actual test nbt file to increase the number of precision mechanisms that are processed to reduce the chance of a fail drastically (less than 0.001%) as in thirty seconds (or equivalent ticks as gametests run faster) ~56 mechanism recipes are processed. I've used creative crates for the golden sheets and the deployer's needed items, so to reduce the chance of fail even further you can just increase the timeout and it should just work. I don't think you'll ever need to do that though.

Thanks,
Jensen

@vercte
Copy link
Copy Markdown
Collaborator

vercte commented Apr 14, 2026 via email

@AyOhEe
Copy link
Copy Markdown
Collaborator

AyOhEe commented Apr 14, 2026

The law of large numbers is fairly reliable. That said, it's not infallible. Could replace the container with a creative crate and wait for all results to appear? Not strictly guaranteed to finish, though.

@JensenJ
Copy link
Copy Markdown
Contributor Author

JensenJ commented Apr 15, 2026

Thanks for your responses. I've had a little look into seeing whether I can make it used a fixed seed, but I wasn't able to find anything in my brief search. Not really sure where to look though.

Chucking a creative crate on the input and the deployers is probably the easiest alternate solution then, I'll probably up the test timeout as well to 30 seconds, to allow more to process.

@JensenJ
Copy link
Copy Markdown
Contributor Author

JensenJ commented Apr 15, 2026

Okay, that's all done. I've updated original message at top of PR. Thanks.

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

Successfully merging this pull request may close these issues.

3 participants