mojira.dev
MC-271728

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

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.

Linked issues

Attachments

Comments 3

Please attach any necessary data packs and detailed steps to reproduce the issue.

This ticket will automatically reopen when you reply.

Changes have been made

Thank you for your report!
We're tracking this issue in MC-251617, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Silver65536

(Unassigned)

Unconfirmed

(Unassigned)

1.20.6

Retrieved