Not sure whether this is intended or not.
The bug
When you hold a block in your offhand slot, a food item in your main hand, and your hunger bar is full, you're able to place that block. As per MC-126337, this should not be possible. This is especially annoying if you just finished eating and you're looking at a block, so you accidentally place the block in your offhand.
To reproduce
Be in Survival mode
Get hungry
Put a block in your offhand slot
Eat something
❌ Accidentally place 20 blocks
Related issues
is duplicated by
Attachments
Comments


Confirmed for 1.13.1.

Confirmed for 1.13.2-pre2.

Confirmed for 21w07a

Interactions are based on an ordered system in the box below. The "+" means that multiple events are a part of the same interaction type and can happen if any mainhand event fails. The "-" means that multiple events are a part of the same interaction type and can only test one event before navigating to the next interaction type. Finally, the "→" denotes a separation of interaction types and the order that the system navigates in:
(armor + fishing rod + shield + bow + crossbow + food + boat + bucket + lily pad + throwables + hoe + ender eye on portal frame) → (minecart - armor stand - flint and steel - fire charge) → placed redstone ore (from MC-195094) → block → entity or placed block
As hinted at above, the interactions are navigated linearly. This means that once the list navigates forwards, there's no going backwards until escaping the in-game interaction attempt completely.
The system also has the following checks that are performed in the order below. If the interaction type is skipped, the next check is not assessed on the current interaction type either (meaning that if the interaction type is skipped, it's all over).
If the interaction type does not match the desired interaction type in the mainhand, the current interaction type is skipped. If the mainhand cannot perform the event, the current interaction type is skipped. If the offhand cannot perform the event, the current interaction type is skipped.
If MC-126337 truly is intended, and if MC-135143 is valid, then there are many more situations that should be added to this ticket (or multiple tickets addressing each issue). For example, when holding any of the items before the first arrow (say a boat) in the mainhand, and any of the items after the first arrow and before the last arrow (say a minecart) in the offhand, then if the mainhand fails, the offhand event will always be tested rather than skipped. If these items were swapped between the mainhand and offhand however, the entire interaction would cease as per MC-126337.
Extra information:
If a minecart is in the mainhand while a boat is in the offhand, the boat could never possibly be placed because the interaction type that performs the event is already skipped. If armor is in the mainhand and an block is in the offhand, the block could still be placed if and only if the armor event fails (which is the same case as MC-135143). If a bow and a lily pad are held at the same time, both have a full chance to be placed if whichever one that is in the mainhand fails (which is the same case as MC-218114). Finally, if a minecart and an armor stand are held at the same time, whichever one that is in the offhand could never possibly be placed since that specific interaction type stops testing more events after one fails.
Can confirm in 1.20.2

Please update the summary to: "You can use items in your offhand slot if you have food in your main hand but your hunger bar is full" This applies to any item with right-click actions in the offhand, not just blocks.