Solved Boss Bar Progress Problem

Discussion in 'Plugin Development' started by MrGriefer_, Apr 22, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    MrGriefer_

    Hello everyone,

    I'm working on a plugin which uses boss bar and the method .setProgress maximum progress is 1, what I'm trying to do is to set the progress to be the player's lives which is 5 but since the maximum progress is 1 I can't set that. Is there a way I can get the double from the lives (It can be other than 5) ?

    Sorry for my bad english.
     
  2. Offline

    thechrisanator

    you can make the progress equal to the player's health divided by the max health for the player. In this case it would be progress = player's health divided by 5
     
  3. Offline

    MrGriefer_

    Thank you that worked, I have no idea why I didn't think of that!
     
Thread Status:
Not open for further replies.

Share This Page