Up until snapshot 14w07a, it was possible to do a command such as /tp @p @e[type=Villager,c=-1] to teleport the player to whichever villager was added to the world most recently. Right now, it seems to alternate between selecting the oldest and newst matching entity instead.
Linked issues
is duplicated by 3
Comments 6
I assume this is working as intended; the @e selector will now select the nearest entities and outwards. The "c" limits the number of entities to select, so "c=1" would select the closest entity, while "c=-1" would select the farthest.
When it was originally added, c=n was meant for "nearest n players" for n>0, and "farthest n players" for n<0. This behavior was broken when @e was added, because the game didn't sort the entity list by distance anymore. It only seemed to provide results by age because it iterated the world's entity list as-is, and most recently added entities were last. It didn't work properly for commands such as @e[c=-1,type=Villager,r=1000], because then it would iterate by chunk instead of by the world's entity list. It was never meant to sort by age; it was just a fluke because it didn't sort by anything in particular.
In short, this is Working as Intended, because c was never meant to sort by age; Dinnerbone even said it sorts by distance when it was originally added. [c=-1] reliably selects the farthest entity; no selector at this time exists for "newest" or "oldest" entity. The behavior of c shouldn't be changed, as it far predates @e; maybe post a suggestion on the forums for a new age-based selector instead.
it also doesn't work if i exclude the player via Names, things like radius work
On kinda way, Absolute X and Z values with relative y dont work either