-
Notifications
You must be signed in to change notification settings - Fork 3
Compatibility
Good news for you: you can make your plugin compatible without hooking! Just make sure to use this methods if you want to change an entity's health, after your calculations:
entity.setMaxHealth(...);
entity.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
.
Example:
import com.gmail.davideblade99.healthbar.api.BarHideEvent;
@EventHandler
public void onBarHide(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: https://pastebin.com/nZ6Pwvnj
Finally, you can add these lines to plugin.yml
to make it load after HealthBar:
softdepend: [HealthBar-Reloaded]
Plugins that uses the Scoreboard(s)
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 config.yml (use-player-bar-permissions: true
), 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 config.