★ BossBar

Sep 16, 2018
★ BossBar
  • Minecraft 1.8 BossBar Methods
    Code:
    TTA_Methods.setBossBar(Player p, String text, float health, boolean fixViewDirectionUpdater); = create a bossbar for the specified player
    TTA_Methods.hasBossBar(Player player); = check if the player has a bossbar (works for both the 1.8 & 1.9+ bossbar)
    TTA_Methods.removeBossBar(Player player); = remove the player's bossbar (works for both the 1.8 & 1.9+ bossbar)
    Notes:
    • p = player
    • text = message shown above bossbar
    • health = 0-100 bossbar indication
    • fixViewDirectionUpdater = if true, the bossbar will be updated every 2 seconds to fix not showing at some view directions (set this to false if you use this method multiple times in 2 seconds else to true)


    Minecraft 1.9+ BossBar Methods
    Code:
    TTA_Methods.createBossBar(player, text, progress, barstyle, barcolor, barflag, visible);
    TTA_Methods.setBarTitle(text);
    TTA_Methods.setBarProgress(progress);
    TTA_Methods.setBarColor(color);
    TTA_Methods.setBarStyle(style);
    TTA_Methods.addBarFlag(flag);
    TTA_Methods.setBarVisibility(visible);
    TTA_Methods.removeBarFlag(flag);
    TTA_Methods.hasBossBar(Player player); = check if the player has a bossbar (works for both the 1.8 & 1.9+ bossbar)
    TTA_Methods.removeBossBar(Player player); = remove the player's bossbar (works for both the 1.8 & 1.9+ bossbar)
    Type & usage of variable:
    • player = Player - Player that the bar is created for / Player which gets his bar removed. [2]

    • text = String - Text that will be shown in the bossbar.
    • progress = Double - Option to set how far the bar is progressed. [1]
    • color = BarColor - Color of the bar.
    • style = BarStyle - Set the style the bar is displayed like.
    • flag = BarFlag - Set a flag that is executed / created by the bar.
    • visible = Boolean - Set if the player can see the bar created for him.


    Notes:
    [1] - Must be a value between 1.0 - 0.0 (100% - 0%)
    [2] - Bar need to be created for the player before removing it.