When Shift-clicking items into a hopper which feeds them back to the player, a ghost item can be created. once created, the ghost item can be added.
- make a setup that automatically feeds back items you input to a hopper like the one in the image
- put at least two different items in your inventory (works best with 3+)
- begin shift-clicking the items into the hopper as fast as you can
- if a ghost item is created, make sure it is not on the leftmost slot of the hopper inventory
- shift-click the ghost item over and over to create duplicates of it
- (optional) shift-click the ghost items into your inventory, it will appear as though you duplicated them and if you try and interact with them or exit the hopper inventory they may disappear
Note: this works both in survival and creative modes