mojira.dev
MC-106826

Can interact with (eat) cake in creative mode/hunger bar is full

The bug

You can interact with cake in creative mode or when your hunger bar is full.

Fix

BlockCake.java

/**
 * Called when the block is right clicked by a player.
 */
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
    // Comment: Replaced this
    //if (!worldIn.isRemote)
    //{
    //    return this.eatCake(worldIn, pos, state, playerIn);
    //}
    //else
    //{
    //    ItemStack itemstack = playerIn.getHeldItem(hand);
    //    return this.eatCake(worldIn, pos, state, playerIn) || itemstack.isEmpty();
    //}
    return this.eatCake(worldIn, pos, state, playerIn);
}

Linked issues

Attachments

Comments 23

Still an issue in 16w40a.

Affects 18w22c

Affects 1.13-pre1

Affects 1.13-pre2

Affects 1.13-pre3

13 more comments

Affects 19w13b, can I request ownership?

Affects 19w14a

Affects 19w37a

Fixed in 19w42a. A bug remains with cake that is better described in MC-114718.

Can we have it so that we can eat cake in creative mode please?
When building with redstone in hexadecimal, cakes are way less laggy than Block Entities and having to switch to survival, put a hunger affect on and then eat the cake is really really slow
Most servers dont allow /effect or /setblock - So it has to be done manually

[Mod]Les3awe

coschevi

Confirmed

Player

cake, eat, hunger, interaction, survival

Minecraft 1.10.2, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w36a, Minecraft 16w38a, ..., 19w34a, 19w35a, 19w36a, 19w37a, 19w39a

Minecraft 16w40a, 19w42a

Retrieved