The bug
When checking a range in the entity_scores
condition, you either need to specify an exact value, or both the lower and upper bounds. Using only min or only max results in the loot table or predicate not being loaded.
How to reproduce
Create the following predicate in a data pack
{ "condition": "minecraft:entity_scores", "entity": "this", "scores": { "foo": { "min": 1 } } }
❌ Reload the world and notice that the predicate did not load
"Missing max, expected to find a Float"
Linked issues
is duplicated by 1
relates to 1
Attachments
Comments 17
@unknown: in many other situations in Minecraft, an unspecified min or max will mean that it doesn't have to be checked at all. For example, signal_strength
in the "target_hit" trigger does not require both a min and max to be specified:
{
"criteria": {
"custom_test_name": {
"trigger": "minecraft:target_hit",
"conditions": {
"signal_strength": {
"min": 10
}
}
}
}
}
Thus it is a min of 10. A signal strength of 12 is more than 10, so it matches. Another example is the distance
parameter for selectors, where the min is implicitly 0 and the max is also implicitly 2147483647.
Meaning in the situation with scores, the implicit values would be the upper and lower bound that scores can have (MIN_INT/MAX_INT). Or just not checked at all as the entity_scores
condition is just that: a true/false condition, not a random number selection.
So how is your example supposed to be read? "No less than 1 but no more than infinite"? I'd expect it to interpret a missing value as the default (zero), but "at least one but less than zero" makes no sense.
Also keep in mind that it affects odds. "min: 4 max: 6" would mean there's a 1 in 3 chance of getting a four, a 1 in 3 of getting a five, and a 1 in 3 chance of getting a 6. How does the game know what the odds of getting a 1 are if the range isn't specified?