CMI bossbar handling - MathiasMC/BattleDrones GitHub Wiki

CMI bossbar usage.

You must have the CMI plugin installed.

Example of displaying the ammo consumption (video).

General format: cmi bossbarmsg <playerName> <text> <parameters>.

To implement the one shown in the video, add this command to the drone config under run section:

cmi bossbarmsg {player} &6%battledrones_active% &fdrone ammo: &b%battledrones_ammo% &7/ &3%battledrones_ammo_max% -c:red -s:10 -p:100/%battledrones_ammo_percent% -n:droneAmmo

For example, there used machine-gun drone when attacking animals:

    run:
      player:
        - 'bd sound entity_firework_rocket_blast {world} {x} {y} {z} 1 1.5'
      monster:
        - 'bd sound entity_firework_rocket_blast {world} {x} {y} {z} 1 1.5'
      animal:
        - 'bd sound entity_firework_rocket_blast {world} {x} {y} {z} 1 1.5'
        - 'cmi bossbarmsg {player} &6%battledrones_active% &fdrone ammo: &b%battledrones_ammo% &7/ &3%battledrones_ammo_max% -c:red -s:10 -p:100/%battledrones_ammo_percent% -n:droneAmmo'

Variables explanation

-c - bossbar color. Format: -c:<color>. Possible colors:

blue
green
pink
purple
red
white
yellow

-s - Defines how many sections the bossbar will be divided into. Possible values: 1, 6, 10, 12, 20.

-p - Percentage. Format -p:<filled>/<left>.

-n - Bossbar's name. Format: -n:<anyCustomName>. If you do not specify this parameter, then with each shot a new bossbar will appear and this will lead to glitches. The name is needed to update an existing bossbar instead of creating a new one.

⚠️ **GitHub.com Fallback** ⚠️