I've been building an elevator that constantly teleports an armor stand (with the tag "eleStand") to create movement, only entities with the tag "eleUp" or "eleDown" are teleported, and to stop the elevator, those tags are removed. To stop the elevator at each floor, I've placed an armor stand with the tag "floorMarker" at each floor. The below command runs in a repeating command block, and is meant to remove all movement tags from the elevator when it is at the same location as a Floor Marker armor stand:
And the commands the move the elevator up and down:
tp @e[tag=eleDown] ~ ~-0.05 ~
tp @e[tag=eleUp] ~ ~0.05 ~
The problem I'm having is that the elevator stops at each floor, but only below the height it was created.
It tried spawning the armor stands at different floors in a shaft, and the elevator would only stop at floors that were below it when it was created, any floors that were above the elevator when it was spawned, would not be stopped at.
ah! simple instead of r=0 which only worked in 1.8, try dy=0
Thanks for the advice, however I've found that using dy=0 causes the elevator to stop 2 blocks short of the floor marker armor stand when approaching from above, but stops fine when approaching from below. I tried replacing the floor marker armor stand with a shulker, and the elevator only stopped 1 block short, so it looks like it depends on the size of the entity. However, the elevator still uses an armor stand as a base, and shulkers can't be moved by themselves in sub-block increments, and the NoAI tag no longer stops other mobs being effected by gravity, so I havn't been able to use entities such as chickens, bats, etc.
To prevent confusion, by the elevator stopping 1 or 2 blocks short, I mean the shulker and falling sand entities (that are riding 1.5 blocks above the base armor stand)