mojira.dev
MC-183880

Distracting baby piglins with gold grants the 'Oh Shiny' advancement

The bug

The advacement 'Oh Shiny' is granted by throwing a gold item near a baby piglin while not wearing any gold armour, even though baby piglins are naturally not angry towards players which doesn't make sense.

To reproduce

  1. Have a gold ingot in your main hand

  2. Go to survival with no gold armor

  3. Drop the gold ingot near the baby piglin
    → ❌ The 'Oh Shiny' advancement is granted.

Attachments

Comments 3

A simple fix would be to add an is_baby predicate flag to check if it is an adult Piglin:

{
  "parent": "minecraft:nether/root",
  "display": {
    "icon": {
      "item": "minecraft:gold_ingot"
    },
    "title": {
      "translate": "advancements.nether.distract_piglin.title"
    },
    "description": {
      "translate": "advancements.nether.distract_piglin.description"
    },
    "frame": "task",
    "show_toast": true,
    "announce_to_chat": true,
    "hidden": false
  },
  "criteria": {
    "distract_piglin": {
      "trigger": "minecraft:thrown_item_picked_up_by_entity",
      "conditions": {
        "player": [
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "equipment": {
                  "head": {
                    "item": "minecraft:golden_helmet"
                  }
                }
              },
              "entity": "this"
            }
          },
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "equipment": {
                  "chest": {
                    "item": "minecraft:golden_chestplate"
                  }
                }
              },
              "entity": "this"
            }
          },
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "equipment": {
                  "legs": {
                    "item": "minecraft:golden_leggings"
                  }
                }
              },
              "entity": "this"
            }
          },
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "equipment": {
                  "feet": {
                    "item": "minecraft:golden_boots"
                  }
                }
              },
              "entity": "this"
            }
          }
        ],
        "item": {
          "tag": "minecraft:piglin_loved"
        },
        "entity": [
          {
            "condition": "minecraft:entity_properties",
            "predicate": {
              "type": "minecraft:piglin",
              "flags": {
                "is_baby": false
              }
            },
            "entity": "this"
          }
        ]
      }
    }
  },
  "requirements": [
    [
      "distract_piglin"
    ]
  ]
}

A simple fix would be to add an is_baby predicate flag to check if it is an adult Piglin:

{
  "parent": "minecraft:nether/root",
  "display": {
    "icon": {
      "item": "minecraft:gold_ingot"
    },
    "title": {
      "translate": "advancements.nether.distract_piglin.title"
    },
    "description": {
      "translate": "advancements.nether.distract_piglin.description"
    },
    "frame": "task",
    "show_toast": true,
    "announce_to_chat": true,
    "hidden": false
  },
  "criteria": {
    "distract_piglin": {
      "trigger": "minecraft:thrown_item_picked_up_by_entity",
      "conditions": {
        "player": [
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "equipment": {
                  "head": {
                    "item": "minecraft:golden_helmet"
                  }
                }
              },
              "entity": "this"
            }
          },
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "equipment": {
                  "chest": {
                    "item": "minecraft:golden_chestplate"
                  }
                }
              },
              "entity": "this"
            }
          },
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "equipment": {
                  "legs": {
                    "item": "minecraft:golden_leggings"
                  }
                }
              },
              "entity": "this"
            }
          },
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "equipment": {
                  "feet": {
                    "item": "minecraft:golden_boots"
                  }
                }
              },
              "entity": "this"
            }
          }
        ],
        "item": {
          "tag": "minecraft:piglin_loved"
        },
        "entity": [
          {
            "condition": "minecraft:entity_properties",
            "predicate": {
              "type": "minecraft:piglin",
              "flags": {
                "is_baby": false
              }
            },
            "entity": "this"
          }
        ]
      }
    }
  },
  "requirements": [
    [
      "distract_piglin"
    ]
  ]
}

DrownedZombie

Panda4994

Confirmed

Normal

Advancements

20w20a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2

1.16 Pre-release 3

Retrieved