Zrips / CMI

117 stars 99 forks source link

Bossbar Messages stop updating when used with -t #4434

Closed NightFuryStrike closed 4 years ago

NightFuryStrike commented 4 years ago

Description of issue: Greetings, I was trying to use a combination of attached commands and boss bar messages to create a mana bar whenever a magic item is used on my server.

Currently the boss bar works, but stops updating after a short time. It only updates if I use -sec instead of -t, but I want the text in the boss bar to continue updating when using -t

Here is the command I was using: /cmi bossbarmsg [playerName] &e&lMana: &b&l%mana_mana%/%mana_max_mana% &b%mana_mana_bar% &d(+%mana_mana_regen%/s) -n:manabar -a:1 -t:5 -c:blue -s:1

When using -t:5 the boss bar will stop updating after 5 seconds and freeze for another 5 seconds (which is the duration of -t:5) (using -a:1) and will only update if a proper timer flag is used (such as -sec:5 or -p:+1 along with -t:0)

The fix I would like to see is for boss bar messages to continue updating if -a is used along with -t.


Easy way for you to test this: For quick testing without PlaceholderAPI, you can use /cmi bossbarmsg [playerName] &6Location: &a%player_x% %player_y% %player_z% -n:locationbar -a:1 -t:5 -c:blue -s:1

This will print your current location in the boss bar using CMI placeholders. Move around while this boss bar is visible. Notice how the coordinates stop updating after 5 seconds? This is the exact same issue I am having.

Edit: It also appears that bossbar messages do not update when used with /cmi attachcommand.

Try using /cmi attachcommand !cc!cmi bossbarmsg [playerName] &6Location: &a%player_x% %player_y% %player_z% -n:locationbar -a:1 -t:5 -c:blue -s:1 and then use the item. You will notice that the boss bar does not update at all.


Extra Another thing I tried to do was combine -a -t -p together to have the bar progress change depending on the user's current mana level, by adding -p:%mana_max_mana%/%mana_mana% to the end of the command. Unfortunately this does not work because the boss bar thinks I'm trying to use it as a timer and does not update properly. Maybe the introduction of a new flag to use placeholders for the bar progress but have the timer be separate would expand the ways we can use bossbar messages?

Thank you for your consideration.

Cmi Version (using/cmi version): 8.7.8.4 Server Type (Spigot/Paperspigot/etc): Paper-245 Server Version (using /ver): 1.16.3 Relevant Plugins: PlaceholderAPI

Zrips commented 4 years ago

Will make some adjustments to keep updating placeholders even during hide cycle. As currently it was stopping at moment counter stops, while it was taking -t value for keep time in case there is no provided timer value, which will be fixed too, as we should default to 0 main counter time if its not provided instead of duplicating keep time. Anyways, should work with next version.