When the player attacks as the piston returns, the item increases to two.
Place items in the piston and item frame.
Next, place the power related to Redstone beside the piston.
Then, put the power and move the piston.
After that, when the player attacks when the power is cut off and the piston returns, the frame will come off and items will be two at the same time.