just calculate a "hidden" position value (your current position value),
and then put the entity every frame to
an absolute value ( something like pos_x = int(pos_x_curr/21)*21