tag @e[type=item,distance=..3] add NoTagRDT
tellraw @s ["",{"text":"Your dubloon shines a little bit...","color":"yellow","italic":true}]
give @s minecraft:gold_nugget{display:{Lore:["\"Throw me on the ground for a surprise!\""]}}
tag @e[tag=!NoTagRDT,type=item,distance=..2,sort=nearest,limit=1,nbt={Item:{Count:1b,tag:{display:{Lore:["\"Throw me on the ground for a surprise!\""]}}}}] add GoldNuggyNoRDT
tag @e[type=item,distance=..3] remove NoTagRDT
