Minecraft – How to detect an item on ground

minecraft-commandsminecraft-java-edition

I searched on internet including this site, people said that it worked for them.

I wanna detect a paper laying on the ground and if there is a paper on the ground it runs an command.

I tried this command but it doesn't work.

/execute as @e[type=item,nbt={Item:{id:"minecraft:paper",Count:1b,tag:{onGround:1b}}}] run say test 

Update: More specifically how to make this command:

/execute as @e[type=item,nbt={Item:{id:"minecraft:paper"}}] at @s run say test

Work only on papers that are on ground?

Best Answer

You miscapitalized OnGround as onGround.

Correct:

{OnGround:1b}