"Entity killed" event does not work in most cases
21w05a added the entity killed event. However, the entity hurt event overrides this in most cases, except for killing an armor stand. (It also does not work for boats, items, or minecarts, but the way the code is written makes these specific instances seem intentional)
This can be seen by attaching a comparator to a sculk sensor. Killing most entities gives a power of 8, while it should give a power of 13.
Relates to MC-213668
Created Issue:
"Entity killed" event does not work in most cases
21w05a added the entity killed event. However, the entity hurt event overrides this in most cases, except for killing an armor stand. (It also does not work for boats, items, or minecarts, but the way the code is written makes these specific instances seem intentional)
This can be seen by attaching a comparator to a sculk sensor. Killing most entities gives a power of 8, while it should give a power of 13.
21w05a added the entity killed event. However, the entity hurt event overrides this in most cases, except for killing an armor stand. (It also does not work for boats, items, or minecarts, but the way the code is written makes these specific instances seem intentional)
This can be seen by attaching a comparator to a sculk sensor. Killing most entities gives a power of 8, while it should give a power of 13.
Relates to
MC-213669
relates to
21w05a added the entity killed event. However, the entity hurt event overrides this in most cases, except for killing an armor stand. (It also does not work for boats, items, or minecarts, but the way the code is written makes these specific instances seem intentional)
This can be seen by attaching a comparator to a sculk sensor. Killing most entities gives a power of 8, while it should give a power of 13.
Relates to
MC-21366921w05a added the entity killed event. However, the entity hurt event overrides this in most cases, except for killing an armor stand. (It also does not work for boats, items, or minecarts, but the way the code is written makes these specific instances seem intentional)
This can be seen by attaching a comparator to a sculk sensor. Killing most entities gives a power of 8, while it should give a power of 13.
Relates to
MC-213668
The bug
There's a function in CakeBlock.java that triggers the block_destroy game event if the last slice of cake is eaten:
if (n < 6) { levelAccessor.setBlock(blockPos, (BlockState)blockState.setValue(BITES, n + 1), 3); } else { levelAccessor.removeBlock(blockPos, false); levelAccessor.gameEvent((Entity)player, GameEvent.BLOCK_DESTROY, blockPos); }
However, this does not work correctly in game. If you eat the last slice of cake near a sculk sensor attached to a comparator, it will give a strength of 8, which is the normal eat event, instead of 13, which is the block destroy event.
Relates to MC-213947
Can confirm, sculk sensors prefer the entity damaged. Though the event is still emitted properly, so it's a case of removing the emission of entity hurt if the entity dies
Can confirm for 21w08b
Can confirm for release 1.19
This looks fixed to me in 23w05a (possibly earlier). Killing an entity with either /kill or manually gives an output of 13. Can someone please double check?