While attempting to set up several command block to alter custom model data for items put into item frames, I found that once /data had established it's first target in a session it would not fin another. I restarted game and targeted a distant item frame first and it broke the one I had working already as it kept targeting the one I manually located earlier.
The attached screenshot shows the command used to target the item frame behind the pointer, but the output shows that it's targeting an item frame numerous blocks away.
Addendum, when using an entity's unique identifier (73a1a4ba-7869-4fb9-92b4-ccce70ddda6a for example) the item frame can be targeted. But when new coordinates are used as an argument it continues to return the first target, even when it does not match the new arguments. This is the case for both player executed and command block executed commands.
Attachments
Comments 6
This doesn't work, choosing to sort nearest sorts from closest to executing source, not by the location that is given. The fact that I have given an exact location and it's not checking that location but pulling the last result is the issue. This worked properly in previous snapshots.
You need either distance
or sort
, otherwise you're just setting the origin of the search then not bothering to include anything that makes use of it
I have also attempted distance=..1 and it failed to locate anything when I did this. Despite there being an item frame in the location identified. because it is trying to see what overlaps distance from execution and the x,y,z coords.
Again this functions for the first execution, every time after load. but after that it fails to locate another target until you close and reload the save.
For hahas I deleted the snapshot form my PC and re-downloaded it. I don't seem to be having the issue anymore, maybe it was just an error during my initial download? Anywho it's running fine for now, sorry for the headache.
Now to see if there's already an issue open for the other problem this had led me into where lore doesn't copy onto a new item properly >_>
Try using
sort=nearest
in the selector, otherwise it will use an arbitrary matching entity