mojira.dev
MC-115067

All instances of entity-matching conditions do not function for advancements

No condition that makes use of an "entity" source functions. This includes:

  1. minecraft:bred_animals trigger.

  2. minecraft:player_damaged trigger.

  3. minecraft:summoned_entity trigger.

  4. minecraft:player_killed_entity trigger.


Given the example advancement, placed in world/data/advancements/custom/cow.json:

{
    "criteria": {
        "findme": {
            "trigger": "minecraft:bred_animals",
            "conditions": {
                "child": {
                    "type":"minecraft:cow"
                }
            }
        }
    }
}

And the following command to test it at will (see MC-115064 for namespace issue):

/advancement test @p minecraft:custom/cow

Breeding two cows to create a calf will not fulfill the condition, showing no errors. The same occurs with the parents array, though they would likely both be fixed at the same time.

Linked issues

Comments 3

Expanded to include all instances of entity matching.

You were right, if the decompiler decompiled the class ac (17w13a name) correctly the method ac.a is very likely causing that.

public boolean a(@Nullable ub ub2) {
    if (this == a) {
        return this == a;
    }
    if (ub2 == null) {
        return false;
    }
    if (this.b != null && !ud.a(ub2, this.b)) {
        return false;
    }
    return false;
}

It should probably return true in the end since all non-matching tests have failed.

if (this == a) {
        return this == a;
    }

... I feel like that can be improved, haha.

Skylinerw

Nathan Adams

Confirmed

advancement, bred_animals, entity, player_damaged, player_killed_entity, source_entity, summoned_entity

Minecraft 17w13a

Minecraft 17w14a

Retrieved