Executing any data command such as:
/data get entity @e[distance=5,type=minecraft:shulker,limit=1]
Always gives the error:
No entity was found
Even if the entity is inside the specified radius.
Investigating the bug i found that the bug is caused by the distance tag.
Linked issues
Attachments
Comments 10
in the 1.12 when you use the distance tag with a integer number the game converts this integer to a decimal number
Commands are harder than in 1.12, from what snapshot the selector tags' value type must be EXACTLY the type used by the tag?
The command you originally used is not wrong syntax wise; but it will only target entities exactly 5 blocks away; distance is a range, like how rm and r together were, 1 = exactly 1, 1.. = 1 or more, ..1 = 1 or less, 1..2 = from 1 to 2 (inclusive); you don't need to provide decimals for it to work, but you can.
Yes, the shulker is 1 block away from the execution position and gives the error "No entity was found".
I tested the selector with a /say command and the shulker 1 block away from execution position and the command prints the player's name of players inside the radius(not tested on multiplayer)
Your using the distance tag wrong. It should be /data get entity @e[distance=..5,type=minecraft:shulker,limit=1] for it to detect all entities in a range of 5 blocks away from you,
The reason why is that ..5 is equal to a whole five, and this parameter works in decimals (example: 1.1)