This library offers some basic tools for simulating the elements of Minecraft speed runs.
Specifically, Java edition 1.16.1 blaze fights and piglin barters.
The goal of this library is to help investigate the statistics of blaze fights and piglin barters
with respect to Dream's cheated 1.16.1 runs.
For more information, please read the paper.
I am not part of the Minecraft mod team, and they have not asked for, reviewed, or signed off on this code.
I have written this specifically out of my own interest and desire to verify or rebut their report.
I came at this with no expectation of the result, however, you can tell by the language above what my findings were.
You can use cargo-edit
to add the library from crates.io:
PowerShell
cargo add mc_sim
I recommend cloning this repo and running the examples to see the results for yourself.
```PowerShell
cargo run --release --example blazeroddistribution
cargo run --release --example enderpearldistribution
cargo run --release --example blazeroddistribution -- -t 32 -c 1000000000
cargo run --release --example simulatestreamstil_dreams -- --help
#
#
cargo run --release --example simulatestreamstil_dreams ```
The simulation in this library is based on the decompiled Minecraft code, using MCP Reborn.
I decompiled the code myself and came up with my own implementation, that is independent of
any other previous analysis. Drops are all uniform random with exactly the same odds as in Minecraft.
The distributions in this library are based on my best understanding of the statistics involved.
I am not a statistician and I don't have a relevant education. However, the paper provided a good
basis for creating these and the Minecraft speed running Discord has been very helpful in answering
my stats questions.
The purpose of these distributions is to compare how our expectations and modeling of minecraft stats
lines up with the simulated results. They are also used to quantify how lucky a run is during simulation.
100,000,000 samples, showing how the model and the simulator produce very similar results.
In blue are the samples from the simulator, in orange is the statistical model.
BlazeRodDistribution
uses a negative binomial that works over successful blaze fights out of total fights.
Specifically: n = Tr
-- p = 1 / 2
Where:
n
is the number of successes expected by the negative binomial distribution.p
is the probability of a successful fight (a fight that drops a blaze rod).Tr
is the target number of blaze rods that are required for all the runs in the simulation.1 / 2
is the odds of a blaze dropping a blaze rod.This distribution works with any configuration of target rods per run in the simulation with no appreciable
difference to large amounts of sampled data. This distribution produces exactly the same result as the
distribution used in the paper when fed the data from Dream's runs.
100,000,000 samples, showing how the model and the simulator produce very similar results.
In blue are the samples from the simulator, in orange is the statistical model.
EnderPearlDistribution
uses a negative binomial that works over successful barters out of the total barters.
Specifically: n = Tp / Rp * Mp
-- p = 20 / 423
Where:
n
is the number of successes expected by the negative binomial distribution.p
is the probability of a successful barter (a barter that drops pearls).Tp
is the total number of pearls required within the simulation that the distribution is being used for.Rp
is the number of pearls required per run within the simulation.Mp
is the average number of barters required to get to Rp
. 20 / 423
is the odds of a barter dropping ender pearls in 1.16.1, verified from the minecraft jar data.The ender pearl distribution only works in the case where each run has the same target. This means that
it does not align well when you ask it to model simulations of runs with different target pearl counts.
This limitation means that the ender pearl distribution used does not produce the same result as the paper.
The paper worked over successful barters out of total barters, which is considerably easier to model.
Ultimately, I haven't done any better here. Indeed, this is a much less precise model for answering the
question of "how lucky did Dream get?"
This model is considerably more Dream favoured for two reasons:
Odds of Dream's blaze luck as per this model: 8.791412042796765e-12
Odds of Dream's ender pearl luck as per this model: 6.713608557973316e-10
This library is provided under the wtfpl, or MIT, or Apache 2.0.
Take your pick, see: LICENSE-WTFPL, LICENSE-MIT, and LICENSE-APACHE.