Pebble Progress Bars
Warning:
This tutorial is not final.
This warning will be removed when completely validated.
Important Notes:
- You can use any requirement!
- You can simply copy, paste, and edit to your preference.
- Doesn't require PlaceholderAPI (see PAPI Progress Bars).
Pebble Progress Bar Example
lore: |-
&8&m &a&l<Requires>&8&m
&8- &eAccrued §d{{rank.req('xp-levelh').total}}&e Levels
&8- &d¤{{rank.req('money').total | money}}&e payment
{% set requirement = rank.req('money') %}
{% set size = 10 %}
{% set Lcolor = "&d" %}
{% set Rcolor = "&3" %}
{% set Lbar = "|" %}
{% set Rbar = "|" %}
{% set bar = "" %}
{% for i in range(1, size * requirement.quotient) %}{% set bar = bar + Lbar %}{% endfor %}
{% set bar = Lcolor + bar %}
{% if requirement.done == false %}
{% set bar = bar + Rcolor %}
{% for i in range(1, size * (1 - requirement.quotient)) %}{% set bar = bar + Rbar %}{% endfor %}
{% endif %}
&8- &eProgress &8[{{bar}}&8]
Walkthrough
- Start with the
lore:
tag within any of the three rankup stages in theranksgui:
.- Note: this can also be used in the subsections of the
list:
if using text for/ranks
.
- Note: this can also be used in the subsections of the
- Add
|
for simple and readable multi-line text in your file. - Prepare your rankup step's description with formatting like
&8&m &a&l<Requires>&8&m
- Incorporate additional lines for other requirements.
- Insert the pebble templating before wherever the progress bar goes.
Templating
{% set requirement = rank.req('money') %}
{% set size = 10 %}
{% set Lcolor = "&d" %}
{% set Rcolor = "&3" %}
{% set Lbar = "|" %}
{% set Rbar = "|" %}
{% set bar = "" %}
{% for i in range(1, size * requirement.quotient) %}{% set bar = bar + Lbar %}{% endfor %}
{% set bar = Lcolor + bar %}
{% if requirement.done == false %}
{% set bar = bar + Rcolor %}
{% for i in range(1, size * (1 - requirement.quotient)) %}{% set bar = bar + Rbar %}{% endfor %}
{% endif %}
- This templating will create a
{{bar}}
placeholder which can be used after the final line of the template. - Put formatting around the bar like:
&8- &eProgress &8[{{bar}}&8]
Customizing
{% set requirement = rank.req('money') %}
{% set size = 10 %}
{% set Lcolor = "&d" %}
{% set Rcolor = "&3" %}
{% set Lbar = "|" %}
{% set Rbar = "|" %}
- Change the
requirement
to get a different requirement's progress.- Example:
rank.req('xplevelh')
- Note: No requirement suffix like
.total
,.progress
, or.quotient
should be used. Output is already handled.
- Example:
- Increase or decrease the
size
to expand or shrink the progress bar. - Edit the color codes in
Lcolor
andRcolor
to your liking. - Use different
Lbar
andRbar
to alter the progress bar's left and right text segments.