when i made a texture for the minecart it looked like this.
does anybody know how to solve this problem
The minecart texture is not mapped to the geometry well. All four sizes of the minecart overlap the same areas, but don't cover those areas completely just due to the fact that they differ in size.
What this means for you in practice is that you stripe doesn't extend far enough on one side or the other. I'm not intimately familiar with exactly how the minecart is mapped because it's an unprofessional mess, but the simplest solution is just to disregard where you think the borders are and start extending your stripe beyond where you think it should go and hope that it doesn't cause it to look wrong somewhere else.