Remove all of a players bossbars?

Discussion in 'Plugin Development' started by bwfcwalshy, Jul 15, 2016.

Thread Status:
Not open for further replies.
  1. Hello, so today I was just testing stuff out in Bukkit and I used the BossBar class from 1.10 (Or whenever it was added). Issue is, now the bossbars will not go and I cannot remove them. Anyone know a command or a way to do this?

    Reloads don't seem to remove them so I have no idea how to remove them. It seems when you add a player the bossbar stacks, even on disable using BossBar#removeAll does not remove the bar.
     
    Last edited: Jul 15, 2016
  2. @bwfcwalshy
    Do you mean will not go as in from the screen or from memory?
     
  3. @AlvinB Not using CraftBossBar, using the BossBar class from Bukkit. I also tried the hide function (setVisible(false) in onDisable but it still does not hide/remove it. Seems like a Spigot/Bukkit bug.
     
  4. Oh wops, sorry about that. Correct me if I'm wrong, but BossBar is just an interface, with only CraftBossBar implementing it?
     
  5. @AlvinB It is indeed an interface, CraftBossBar is just MC's. Im not sure which class implements it but that shouldn't matter since setVisible is what you should use anyway since hide and show are deprecated. Plus removeAll should hide it despite whatever implements it.
     
  6. Offline

    Tecno_Wizard

    @bwfcwalshy, decompiling the Craftbukkit classes to check this out now.

    EDIT: Seems to be a client issue. Can you replicate this on servers where the bossbar is supposed to disappear?
     
  7. Offline

    I Al Istannen

  8. Offline

    Tecno_Wizard

    @I Al Istannen There is a decompiler with a class navigator built into IntelliJ. It's a whole lot easier.

    Walshy, here's the outgoing packet method.

    Code:
    public void removePlayer(EntityPlayer var1) {
            if(this.h.remove(var1) && this.visible) {
                var1.playerConnection.sendPacket(new PacketPlayOutBoss(Action.REMOVE, this));
            }
    
        }
     
    I Al Istannen likes this.
  9. @Tecno_Wizard I'm not sure which servers even use the Bukkit BossBar most use packets and I can't test right now. Maybe a 1.10.2 issue?
     
  10. Offline

    Tecno_Wizard

    @bwfcwalshy, I would guess so. It's probably a client side bug. Look at my edit if you haven't already. It's pretty straight forward to navigate to from the CraftBossBar class.

    Even if it isn't client sided, it's still Mojang's issue. The Bukkit implementation seems to be fine.
     
  11. @Tecno_Wizard It's interesting it doesn't work, I'll test with 1.10 and 1.10.1 if those also have the issue though it seems like it is a Spigot issue. I was going to use packets but realised there was a Boss Bar API so decided to use that. Weird it doesn't work.
     
  12. Offline

    Tecno_Wizard

    @bwfcwalshy, where do you access the bossbar class from? I've never worked with them so I only inspected the craftbukkit classes.
     
  13. Offline

    Tecno_Wizard

Thread Status:
Not open for further replies.

Share This Page