I tested on 3 machines and worked fine for me, try to restart your client or you computer and check it again
or start it in debug mode afrom command line and check for some error in there (-debug 5000)
Let me know!
Well the method used here is "groundItems.closest" so you will only get the one that's the closest to the player
What gunman said is the perfect solution, just get all and filter out what you need ^^