This repository has been archived by the owner on Dec 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Rates
Famro Fexl edited this page Dec 18, 2023
·
2 revisions
A Rate is an object used for implementing randomness in Zones such as item drops and mob spawns. It is used to distribute treasure throughout a Zone, determine the likelihood of clank being added, or influence the type of mob that will spawn in a Zone area.
A Rate is composed of a list of key-value pairs of strings and integers. For each entry, the string defines the data, and the integer defines the weight (or chance) that data will be selected.
For every entry in the Rate list, it is made up of these components:
- A string, which defines the data that will be returned if the entry is selected. In the case of an item, this would be an NBT structure housing the necessary information to spawn the item in the world.
- An integer, which defines the chance the entry will be selected. The percentage chance an entry will be selected is one entry's chance divided by all the entries chances added together. This method is similar to how loot tables operate on the principle of weights as well.
Whenever a Rate is rolled, it returns one of it's entries data. This likelihood is determined by picking a random number, selecting it from a summation of all the entries integers, and determining which entry that number belongs to.