Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-271728

Location of the victim entity for "player_killed_entity" advancement trigger is evaluated in the dimension of the player

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.20.6
    • None
    • Unconfirmed
    • (Unassigned)

      When applying a location check to the victim entity with the "player_killed_entity" advancement trigger, the location check passes when based on the dimension of the player, not the victim entity.

      Using the following advancement:

      {
          "criteria": {
              "the_nether": {
                  "trigger": "minecraft:player_killed_entity",
                  "conditions": {
                      "entity": [
                          {
                              "condition": "minecraft:location_check",
                              "predicate": {
                                  "dimension": "minecraft:the_nether"
                              }
                          }
                      ]
                  }
              }
          }
      } 

      Expected behavior:
      The advancement triggers when the entity is in the Nether, regardless of the player's location.

      Actual behavior:
      The advancement triggers when the player is in the Nether, regardless of the entity's location.

      Steps to Reproduce:
      1. Install the attached datapack

      2. Summon any entity and kill it through gameplay means (such that "player_killed_entity" will trigger) in the following scenarios:
          a. When the player and entity are both in the overworld
          b. When the player is in the overworld and the entity is in the nether (by using tnt or firing arrows through a nether portal)
          c. When the player and entity are both in the nether
          d. When the player is in the nether and the entity is in the overworld (by using tnt or firing arrows through a nether portal)

      3. Observe that the behavior follows the actual behavior outlined above: the message "advancement granted" will only display in cases C and D. Expected behavior would have the message displayed in cases B and C.

            Unassigned Unassigned
            Silver65536 TheSilverDude
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: