mojira.dev
MC-183917

Min and max are both required in entity_scores condition

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

  1. Create the following predicate in a data pack

    {
      "condition": "minecraft:entity_scores",
      "entity": "this",
      "scores": {
        "foo": {
          "min": 1
        }
      }
    }
  2. ❌ Reload the world and notice that the predicate did not load
    "Missing max, expected to find a Float"

Linked issues

Attachments

Comments 17

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?

@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.

Confirmed in 20w21a.

Confirmed in 1.16 Pre-release 1.

Confirmed in 1.16 Pre-release 2.

7 more comments

Confirmed in 20w29a.

Confirmed in 20w30a.

Confirmed in 1.16.2 Pre-release 1.

Confirmed in 1.16.2 Pre-release 3.

Confirmed in 1.16.2.

Misode

boq

Confirmed

Data Packs

1.15.2, 20w20a, 20w20b, 20w21a, 20w22a, ..., 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 3, 1.16.2

20w46a

Retrieved