PHPackages                             inxomnyaa/apibossbar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. inxomnyaa/apibossbar

ActiveLibrary[API Development](/categories/api)

inxomnyaa/apibossbar
====================

A simple virion API for Minecraft Bossbars for PocketMine-MP

0.2.0(1y ago)5513122GPL-3.0-or-laterPHP

Since Apr 17Pushed 1y ago3 watchersCompare

[ Source](https://github.com/inxomnyaa/apibossbar)[ Packagist](https://packagist.org/packages/inxomnyaa/apibossbar)[ RSS](/packages/inxomnyaa-apibossbar/feed)WikiDiscussions pm5 Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

apibossbar
==========

[](#apibossbar)

A simple api virion to create, send, modify and use Minecraft's boss mob indicator bars in Plugins for PocketMine-MP

Advantages
----------

[](#advantages)

It is quite easy to use this API

- It uses a single object
- Fluent setters (use multiple functions in 1 line)
- Cleaner code
- Easier to understand
- No worrying about the used entity id
- 2 types of bars (BossBar is same for all players, DiverseBossBar can be modified per player)
- No "API::function()" calls, just object methods
- Changeable entity (Can be used for actual boss mobs i.e.)

Types
-----

[](#types)

There are 2 types of boss bars.

- BossBar: is used for shared data, so all registered players see the same bar.
- DiverseBossBar: is used for unique data, their data can be changed per player. They can also be set in a batch for multiple players, and will use default values if no specific data is set for a player. The default data is set like on a shared BossBar

API &amp; usage
---------------

[](#api--usage)

A very basic example can be seen here: [BossBarTest](https://github.com/thebigsmileXD/BossBarTest). For a more advanced example you could check out [BossAnnouncement](https://github.com/thebigsmileXD/BossAnnouncement)

Create a new boss bar

```
/** @var BossBar */
$bar = new BossBar();
```

Set the title and/or subtitle

```
$bar->setTitle(string $title = "");
$bar->setSubTitle(string $subTitle = "");
```

Set the color

```
// Available Colors:
// PINK,BLUE,RED,GREEN,YELLOW,PURPLE,REBECCA_PURPLE,WHITE
$bar->setColor(pocketmine\network\mcpe\protocol\types\BossBarColor::RED);
```

Set the fill percentage

```
// Half-filled
$bar->setPercentage(0.5);
```

Add and remove players

```
// Single
$bar->addPlayer(Player $player);// This will spawn the bar to the player
$bar->removePlayer(Player $player);
// Multiple
/** @var Player[] $players */
$bar->addPlayers(array $players);
$bar->removePlayers(array $players);
$bar->removeAllPlayers();
```

Hide and show bar

```
/** @var Player[] $players */
$bar->hideFrom(array $players);
$bar->showTo(array $players);
```

Get and set the entity the bar is assigned to

```
/** @var Entity|Player $entity */
$bar->getEntity();
$bar->setEntity(Entity $entity);
$bar->resetEntity();
```

Single line example

```
/** @var Player $player */
$player = Server::getInstance()->getPlayerByName("Steve");
/** @var BossBar */
$bar = (new BossBar())->setTitle("Hello world!")->setSubTitle("Foo Bar")->setPercentage(0.5)->addPlayer($player);
```

---

**DiverseBossBar has some additional methods to set data per player:**

Reset the data to its defaults

```
$bar->resetFor(Player $player);
$bar->resetForAll();
```

Set &amp; get title for players

```
/** @var Player[] $players */
$bar->setTitleFor(array $players);
$bar->setSubTitleFor(array $players);
$bar->getTitleFor(Player $player);
$bar->getSubTitleFor(Player $player);
$bar->getFullTitleFor(Player $player);// Combined and encoded title & subtitle
```

Set percentage for players

```
/** @var Player[] $players */
$bar->setPercentageFor(array $players);
$bar->getPercentageFor(Player $player);
```

Disclaimer &amp; Information
----------------------------

[](#disclaimer--information)

Coded and maintained by XenialDan

Feel free to open issues with suggestions and bug reports. Please leave as much information as possible to help speeding up the debugging of the issues.

This is a full rework of [BossBarAPI](https://github.com/thebigsmileXD/BossBarAPI). Plugins that used this virion should be upgraded to apibossbar ASAP

Colors and overlays do not work due to not being properly implemented in the client (They use data from the resource pack definitions file). #blamemojang for copy-paste leftovers from Minecraft: Java Edition

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance50

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf0d401aaa8f3041cb3dee39916b961e93ba7af178e4ddf3dae9535f0f98f340?d=identicon)[inxomnyaa](/maintainers/inxomnyaa)

---

Top Contributors

[![inxomnyaa](https://avatars.githubusercontent.com/u/8733998?v=4)](https://github.com/inxomnyaa "inxomnyaa (26 commits)")[![poggit-bot](https://avatars.githubusercontent.com/u/22427965?v=4)](https://github.com/poggit-bot "poggit-bot (2 commits)")[![JavierLeon9966](https://avatars.githubusercontent.com/u/58715544?v=4)](https://github.com/JavierLeon9966 "JavierLeon9966 (1 commits)")[![nicholass003](https://avatars.githubusercontent.com/u/142091702?v=4)](https://github.com/nicholass003 "nicholass003 (1 commits)")

---

Tags

apiboss-bar-apibossbarbossbarapicomposercomposer-librarycomposer-packagehacktoberfestminecraftooppackagistpmmppmmp-viriontitlevirion

### Embed Badge

![Health badge](/badges/inxomnyaa-apibossbar/health.svg)

```
[![Health](https://phpackages.com/badges/inxomnyaa-apibossbar/health.svg)](https://phpackages.com/packages/inxomnyaa-apibossbar)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M49](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
