mojira.dev
MC-213968

Cake is supposed to trigger the block destroyed event when its last slice is eaten, but it does not

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

Linked issues

Comments 5

it think it is intended.It should be the "cake eating" event.

Can confirm in 1.17.1.

Eating the last slice of a cake should be able to distinguish with breaking it with your fist

This looks fixed to me in 23w05a (possibly earlier). Can someone please double check?

Can confirm fixed. As I am not sure of the version it was fixed, I will resolve this as Cannot Reproduce for now.

PancakeIdentity

(Unassigned)

Plausible

Low

Game Events

sculk_sensor

21w05a, 21w06a, 21w10a, 1.17.1

Retrieved