bindentity(entity, target, int x, int z, int a, int direction, int bindanimation, int sortid)
~Bind entity to target, so the target moves, the entity moves.
~x, z, a: relative to target.
~direction: 0 no change 1 same direction as target -1 opposite direction as target 2 always right -2 always left
~bindanimation: 0 No effect. 1 Keep same animation as the target. 2 Also keep same frame as the target. 4 Kill the entity if the animation doesn't match.
~sortid: -1 by default. -1 means that the binded entity is on back the target. you can set 1 to show binded entity in front of target or you can use what-you-want value.
~To unbind a entity, use bindentity(entity, NULL());
~Partial binding is now possible (4183+). Pass NULL() to any axis you do not want to bind.
~Notice: You can combine those values for bindanimation, so it can be 6 which means 2 and 4.