I'm trying to make a generator type thing where an ingot or diamond or something else drops on top of the "generator"'s location when a player is near a certain type of block. I currently have it working but am unsure of how to make the item drop at a certain coordinate or location, so instead the item drops randomly near the player.
on join:
wait 1 tick
while player is alive:
loop all blocks in radius 5 around the player:
if loop-block is a Block of Diamond:
wait 3 seconds
drop a diamond
wait 1 second
This is what I have currently and it works perfectly fine apart from when I try to put in a location.
Thanks for any help!