KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
682 stars 106 forks source link

BossBar#hide does not work reliably #847

Closed lMartin3 closed 1 year ago

lMartin3 commented 1 year ago

The title is wrong, I mean the Audience#hideBossBar method

I'm making a minigame and I'm using the adventure library to handle the bossbar among other things. I'm using a single bossbar object for the entire arena since it's the same for all players. When the game ends, I call Audience#hideBossBar for each player and then set the bossbar to null, this works as intended. On the other hand, when a player leaves early and the game is still ongoing, I only call Player#hideBossBar for that player, but this doesn't seem to work correctly. Sometimes the bossbar gets stuck in the player's screen.

Is there any way for me to clear that bossbar without having to set it to null? (Since it is still needed for all the other players) Thanks in advance

Edit: I'm running the latest paper build for 1.19.2 (304)

> ver
[12:18:46 INFO]: This server is running Paper version git-Paper-304 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 96fdafd)
You are running the latest version
Previous version: git-Paper-255 (MC: 1.19.2)
lMartin3 commented 1 year ago

I found the issue: Despite me calling Audience#showBossBar once, it didn't allow me to individually remove players. The solution was just to loop through all the players and call the player#showBossBar method.