Minecraft wiki entry for Block_and_item_duplication, associated text: https://www.youtube.com/watch?v=U-9ihB7EmKI and https://www.youtube.com/watch?v=mGQLDJ8dNGs&t=3s are in-depth tutorials that show how to do so