# Solved Distance statistics not working

Discussion in 'Plugin Development' started by BeastBomber23, Jun 28, 2021.

Not open for further replies.
1. Offline

### BeastBomber23

Hello. I setup this function so i could get the distance traveled from a player but its only returning 0.

Code:
```    public int getDistanceTraveled(Player ply) //All 1 cm statistics except for fall and climb added together.
{
int Aviate = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Crouch = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Fly = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Horse = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Minecart = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Pig = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Sprint = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Strider = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Swim = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int WalkOnWater = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int Walk = ply.getStatistic(Statistic.AVIATE_ONE_CM);
int WalkUnderWater = ply.getStatistic(Statistic.AVIATE_ONE_CM);

System.out.println(Aviate + " " + Crouch + " " + Fly + " " + Horse + " " + Minecart + " " + Pig + " " + Sprint + " " + Strider + " " + Swim + " " + Walk + " " + WalkUnderWater + " " + WalkOnWater);

return Aviate + Crouch + Fly + Horse + Minecart + Pig + Sprint + Strider + Swim + WalkOnWater + Walk + WalkUnderWater;

}```
Nvm im dumb. All of them are tracking Aviate.

How do i close this

EDIT by Moderator: merged posts, please use the edit button instead of double posting.

Last edited by a moderator: Jun 28, 2021
#1