mojira.dev
MC-126413

Entity conditions for advancements triggers which can only be one type no longer allow you do omit the type condition

The following advancement use to work in 1.12.x

{
  "display": {
    "icon": {
      "item": "minecraft:emerald"
    },
    "title": "Trading in the end",
    "description": "Trading in the end"
  },
  "parent": "example:challenges/root",
  "criteria": {
    "trade_in_the_end": {
      "trigger": "minecraft:villager_trade",
      "conditions": {
        "villager": {
          "location": {
            "dimension": "the_end"
          }
        }
      }
    }
  }
}

From the wiki:

The villager the item was purchased from. The 'type' tag is redundant since it will always be "villager".

However in the 1.13 snapshots, the type tag is now required. The above advancement only works if you add the redundant type field:

{
  "display": {
    "icon": {
      "item": "minecraft:emerald"
    },
    "title": "Trading in the end",
    "description": "Trading in the end"
  },
  "parent": "example:challenges/root",
  "criteria": {
    "trade_in_the_end": {
      "trigger": "minecraft:villager_trade",
      "conditions": {
        "villager": {
          "type": "minecraft:villager",
          "location": {
            "dimension": "the_end"
          }
        }
      }
    }
  }
}

This bug seems like it was introduced due to the changes which were made in 1.13 snapshots to the way entities are registered and constructed. It doesn't seem intentional and I haven't seen it documented in the release notes

Linked issues

Comments 3

Still a problem in 1.13-pre1

Looks like this is a duplicate of MC-125744 which was fixed in 1.13-pre2

DrHenchman

(Unassigned)

Unconfirmed

Minecraft 18w08b, Minecraft 18w09a, Minecraft 18w10d, Minecraft 18w11a, Minecraft 1.13-pre1

Retrieved