When shift-clicking more than one item into your inventory after crafting it, whilst clearing items of that type, the item stays in the inventory until it is either closed and re-opened or picked up by the cursor. Placing the fake item results in a normal decrement of the ghost item stack, although the block is never placed. Crafting and eating eg. a golden apple results in infinite eating.
- Place repeating command block (Always on)
- Craft more than one of the specified item.
- Shift-move the result into your inventory.