mojira.dev
MCPE-68327

Other zombified piglins aggro when you one-hit kill one of them

In previous versions, if you kill a zombie pigmen in one hit, other pigmen in the area do not become hostile because the original zombie pigman that was attacked did not have time to 'call for help.' However, in 1.14.30, (and possibly 1.14.0) other pigmen will start attacking the player.

A video showing the bug: https://youtu.be/AyQB13bOc2o?t=1204

Time stamp: 19:50

Linked issues

Comments 17

Confirmed in 1.14.60. When you kill a zombie pigman in 1 shot, other zombie pigmen nearby will aggro.

Some history: according to MCPE-31168 zombie pigmen should not call others if you kill them with in 1 hit. However, according to MCPE-23041, in an earlier version they did call others when killed with 1 hit. That report is marked "fixed," but it is noted in a comment that the behavior may not be intended, as MC-2432 is still open for Java Edition.

In the video I linked, it shows it in action. I was playing Hardcore, and the world was lost because of it. In my opinion, if you hit a pigman, others should aggro, UNLESS you kill it with a single blow. The logic behind this is, if you kill him in one hit, he doesn't have time to shout for help.

silentwisperer

confirmed for 1.160.59, 1.16.0.61 and 1.16.0.63

also affects windows 10!

Since MC-2432 has been resolved Working As Intended, this issue should be fixed for parity.

affects 1.16.0

7 more comments

affects 1.17.10

According to developer tweet regarding Java Edition anger fixes last summer this is indeed a bug

Henrik Kniberg
@henrikkniberg
Jun 4, 2020
Oh yeah, one more thing. Instakilling (killing a mob with one hit) is considered a stealth kill, so it won't anger other nearby zombified piglins / bees / wolves. Doesn't work for piglins and villagers though, they are too smart to be fooled by it 🙂

https://twitter.com/henrikkniberg/status/1268768009071534080

This seemingly is fixable by adding a filter for non-fatal damage to on_target_acquired component, like this:

"minecraft:pig_zombie_calm": {
        "minecraft:on_target_acquired": {
          "event": "minecraft:become_angry",
          "filters": { "test": "has_damage", "subject": "self", "operator": "not", "value": "fatal" },
          "target": "self"
        }
      },

However, it appears that this actually causes the event call to fail for zombified piglins that are not directly hit, meaning you don’t get the expected chain reaction of anger broadcasts. (Note that when testing this it is helpful to also give zombified piglins an increased follow range so that their anger is noticeable—see MCPE-51161.)

I tested other filters to try to get around this problem and found another problem: you can get the same behavior by putting any filter that will fail in either the on_target_acquired or the angry components, or by removing the components entirely! Doing so causes only the zombified piglin that is directly hit to broadcast anger, only if it is not one-hit killed, and only to a limited number of other zombified piglins. The range and exact number of piglins reached by this broadcast seems variable, but if I line up 17 zombified piglins in a row and hit the first while standing next to it, then only about the first 12 attack me. This seems to be a legacy hard coded behavior that always runs behind the data-driven behavior and only shows itself when the data-driven behavior does not mask it.

Besides the legacy hard-coded behavior, it turns out that the has_damage filter I suggested above just doesn't work with on_target_acquired--it always returns false. To get it to work, you can use damage_sensor, like this:

"minecraft:damage_sensor": {
          "triggers": {
            "on_damage": {
              "filters": { "test": "has_damage", "subject": "self", "operator": "not", "value": "fatal" },
              "event": "minecraft:become_angry",
              "target": "self"
            }
          }
        }

However, unlike on_target_acquired, damage_sensor will not trigger a chain reaction because the zombified piglins that receive the anger broadcast do not themselves have damage. One way to generate the expected chain reaction is to put an entity_sensor component within the minecraft:pig_zombie_angry group, which will trigger them to re-broadcast anger if a non-angry zombified piglin is within broadcast range. This has the advantage of also fixing the problem of newly-spawned zombified piglins not picking up the anger of zombified piglins nearby (part of MCPE-51161). The component would look like this:

"minecraft:entity_sensor":{
        "sensor_range": 32,
        "event_filters": {
          "all_of": [
            { "test": "has_target", "subject": "other", "value": "false" },
            { "test": "is_family", "subject": "other", "value": "zombie_pigman" }
          ]
        },
        "event": "minecraft:become_angry"
      }

Affects 1.17.40.20

This may be fixable just by making the anger component not work for dead mobs, just like hitboxes and healing don’t work on dead mobs. In that way, this issue is similar to MCPE-45081.

All of the behavior component logic I discussed in my previous comments is still valid (and can be used to make an addon in which the behavior works as expected), but it may be disregarded if the fix is as simple as disabling anger on death.

Prudii Gaming

(Unassigned)

361378

Confirmed

Multiple

Android 6.0.1

vanilla-parity, zombified_piglin

1.17.40.20 Beta, 1.17.10, 1.16.200.56 Beta, 1.16.100.57 Beta, 1.16.100.56 Beta, ..., 1.17.2 Hotfix, 1.18.2 Hotfix, 1.19.0, 1.19.73, 1.20.73 Hotfix

1.21.50.28 Preview, 1.21.50

Retrieved