
Help with config via datapack
slammaja opened this issue · 1 comments
Hi,
first off, love your mods, been using them since 1.17.
Now to cut to the chase, I'm struggling with setting generated attributes on relics - rareness, range (flat and percentage), etc. Would you be so kind and explain me what each of the numbers mean? For example on attack damage:
"minecraft:generic.attack_damage": {
"weight": "r50:a50:x0.25:y4:z0.25:u0.05:v0.5:w0.01"
}
- "r" and "a" have to do with weight range (50-50), or one represents rareness the other weight?
- "x" and "y" are flat amount range with "z" increment?
- "u" and "v" percentage range for given attr. and "w" increment?
I tried to figure that out, but I am new to this. If there is any sort of link I am sorry for failing to find that.
Bye and thanks.
Hi there,
No worries, I will attempt to provide some clarity:
- 'r' is the relative weighting against other attributes when determining what attributes will be attached to a relic. So for example, if the Armour attribute has a greater 'r' value than the Max Health attribute, Armour will appear more often on Relics than Max Health. This value can be from 1 to 100, but note that a value of 100 does not guarantee the attribute to be attached to a relic, it just makes it most likely.
- 'a' is the chance for the attribute modifier to be of the addition type (similarly,
1 - a
is the chance for the attribute modifier to be of the multiplier type). So for example, an addition type attribute modifier would be perhaps+3 Armour
; whereas a multiplier type attribute modifier would be+30% Armour
. The 'a' value can be from 0 to 100; where a value of 0 means that the modifier will always be a multiplier type and a value of 100 means that the modifier will always be an addition type. - 'x', 'y', 'z' represent the minimum, maximum and increment values of the attribute modifier should the attribute modifier be of the addition type.
- 'u', 'v', 'w' represent the minimum, maximum and increment values of the attribute modifier should the attribute modifier be of the multiplier type.
Some Notes
- Minimum and maximum values are self-explanatory; increment value defines the minimum difference between attribute modifier values. So for example, if I have
x1:y10:z1
, the attribute modifier could have a value of 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10. Alternatively, if I havex1:y5:z0.5
, the attribute modifier could have a value of 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5 or 5. This is the same principle with 'u', 'v' and 'w'. It is important to note that when setting the increment value, it should be some multiple of the maximum and minimum value such that no remainders are left. For example,x1:y2:z0.3
would not be a good increment value. - If you define the 'a' value to be 100, the 'u', 'v', 'w' values do not matter and will never be used; similarly, if you define the 'a' value to be 0, the 'x', 'y', 'z' values do not matter and will never be used. However, you should still be conscientious about setting both just in case.
I hope that helps. I understand that the configuration for this is fairly convoluted - it is done this way to minimise packet size when the client joins a server (as this information only needs to be defined on the server and is sent to the client), but that is a discussion for another day.
Thanks.