Compatibility

 

Plugins that changes player/mob health

Good news for you: you can make your plugin compatible without hooking! Just make sure to use this methods if you want to change a player's health, after your calculations:

player.setMaxHealth(...);
player.setHealth(...);

For mobs:

mob.setMaxHealth(...);
mob.setHealth(...);

Health Bar will be able to display the corrent health for mobs and players.

Plugins that change teams and their prefixes and suffixes

You can listen to the custom event: BarHideEvent.

e.g.:

import com.gmail.filoghost.healthbar.api.BarHideEvent;

public void barHideEvent(BarHideEvent event) {
   OfflinePlayer player = event.getOfflinePlayer();
   //more stuff, like restoring the tag of your plugin.
}



Full example of a plugin that uses the custom event: http://pastebin.com/dgYbgxjk
Finally, you can add these lines to plugin.yml to make it load after HealthBar:

softdepend: [HealthBar]

Plugins that uses the scoreboard(s)

With Bukkit 1.5.1, it is possible to use the official API for the scoreboard. This plugin uses only the main scoreboard (the one that is saved to the disk) to display players' healths. If permissions are enable in the configs, a fake (empty) scoreboard will be sent to the players without permissions.
Make sure to do your operations on the main scoreboard, and there won't be any problem.

But if you want to use other scoreboards?
Then you'll have to add a compatibility option to use only the main one.

Tell your users to disable permissions in HealthBar configs.