BarAPI

BarAPI

Server Owners

This plugin does nothing on its own. It is simply an API for other plugins to implement with.

Developers

Simply add BarAPI.jar to your project build path.

This plugin makes use of reflection and therefore "shouldn't" break on craftbukkit updates.

Limitations

The message can not be more than 64 characters. If it is more, BarAPI will automatically cut it to 64 characters to prevent the client from crashing.

This is a client limitation and cannot be changed.

Examples

BarAPI.setMessage(Player player, String message)

Set a message for the player. It will remain there until the player logs off or another plugin overrides it.

BarAPI.setMessage(Player player, String message, float percent)

Same as above except you can set the % of the health bar. 100 shows the entire health bar, 50 shows half the health bar and so on.

BarAPI.setMessage(final Player player, String message, int seconds)

Sets a timed message for the player. It will remain until the timer runs out. The health automatically reduces based on how long the timer is.

BarAPI.hasBar(Player player)

Pretty self explanatory, returns a boolean.

BarAPI.removeBar(Player player)

Also pretty self explanatory.

BarAPI.setHealth(Player player, float percent)

Allows you to modify the health of an existing bar. If the player has no bar, this does nothing.

Tutorials

German - DerFeliix

Source

GitHub

Maven

<repositories>
	<repository>
		<id>confuser-repo</id>
		<url>http://ci.frostcast.net/plugin/repository/everything</url>
	</repository>
</repositories>

<dependencies>
	<dependency>
		<groupId>me.confuser</groupId>
		<artifactId>BarAPI</artifactId>
		<version>3.0</version>
	</dependency>
</dependencies>

Updater

This plugin contains an auto updater which is enabled by default. If you do not wish to automatically download new updates, edit BarAPI/config.yml and set autoUpdate to false.

To Dos

  • Scroll messages if string is greater than 64 characters.

Plugins Using BarAPI

WelcomeBar

Parkour

QuickSupport

BossBroadcast

BossMessage

PvPGames Automated

BossEventScheduler

Infernal Mobs

MythicMobs

MultiKill

PlayerBoss

BossAds

Item Lore Stats

BossBarPro

VIPLobby

Battle Of Blocks

BossBroadcaster

SilkSpawners

BarJoin

JoinGlobalMessages

Metrics

To determine popularity and usage of BarAPI, plugin installs are automatically tracked by the Metrics plugin tracking system. Your Java version, OS, player count, server country location and plugin & server versions are collected. This is used to determine what environments are using the plugin to ensure full compatibility. This collection is anonymous. If you don't want this tracking, edit plugins/PluginMetrics/config.yml and set opt-out to true.

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of confuserr confuserr Aug 17, 2014 at 19:31 UTC - 0 likes

    Just tested v3.1 with 1.7.10 and it seemed to work just fine.

    Those that experienced errors, what build did you have the problem with?

  • Avatar of woutwoot woutwoot Aug 14, 2014 at 09:50 UTC - 0 likes

    I've recompiled this plugin with 1.7.10 and java 1.7 and it seems to work. However THIS BUILD IS NOT REVIEWED BY BUKKIT (So basically I could make it destroy your server, it won't, but just have to tell you that) http://wwx.be:8283/job/BarAPI/ You can see everything I've changed here: https://github.com/woutwoot/BarAPI

    BFAK:90564966,9058984c5aff46182908fa633e61adebcfc52b09972fd28bfe0a9ef2798cdd17 Alive and kicking! :p

  • Avatar of xGh0sTkiLLeRx xGh0sTkiLLeRx Aug 13, 2014 at 07:45 UTC - 0 likes

    Pssst, SilkSpawners does use BarAPI, too :)

    Want to have a dropbox acc with 500MB more space? Contact me!

    Need a dev? Drop me a PM!

    Server | Twitter | Github

    Donations are very appreciated!
    http://goo.gl/tXb7G

  • Avatar of confuserr confuserr Aug 11, 2014 at 08:54 UTC - 0 likes

    @frickx: Go

    I'll take a look at the weekend.

  • Avatar of iWareWolf iWareWolf Aug 09, 2014 at 15:24 UTC - 0 likes

    Please update to 1.7.10. :)

  • Avatar of frickx frickx Aug 07, 2014 at 23:40 UTC - 0 likes

    seems that it doesnt work with spigot 1.7.10 :/

    Caused by: java.lang.NullPointerException
            at me.confuser.barapi.Util.sendPacket(Util.java:71) ~[?:?]
            at me.confuser.barapi.BarAPI.addDragon(BarAPI.java:423) ~[?:?]
            at me.confuser.barapi.BarAPI.getDragon(BarAPI.java:417) ~[?:?]
            at me.confuser.barapi.BarAPI.setMessage(BarAPI.java:279) ~[?:?]

    Also not with craftbukkit-1.7.9-R0.2

    Last edited Aug 08, 2014 by frickx

    BFAK:90942591,aefcd9cc5dde25b758520881a32e7a08fde89feb187b769dbcaec5e3bcd41d51

  • Avatar of confuserr confuserr Aug 07, 2014 at 08:14 UTC - 0 likes

    @kevc45: Go

    You need the plugin on your server. The maven dependency is simply for building your plugin. Also, why are you using 3.0 when 3.1 is the latest?

  • Avatar of kevc45 kevc45 Aug 07, 2014 at 02:04 UTC - 0 likes

    Hey, the BarAPI 3.0 maven dependency seems to be broken. Because when I just include the downloaded jar from dev.bukkit it works.

    Here is the error I get: "This server is running CraftBukkit version git-Bukkit-1.7.2-R0.3-66-g43d8943-b3078jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.1-SNAPSHOT) Ambiguous plugin name `BarAPI' for files `plugins\PluginName-1.0.jar' and `plugins\BarAPI.jar' in `plugins'" Also my plugin does not enable.

    BFAK:kevc45,90635044,731da99c89158210bc96c4b33e8440dd432af947a6279cdcb0bad4b3a8bbfd96

    http://i.imgur.com/u7sXdc4.png
    http://dev.bukkit.org/bukkit-plugins/classesrp/

  • Avatar of madtomic madtomic Jul 30, 2014 at 04:27 UTC - 0 likes

    any permissions for this plugin?

  • Avatar of Desle Desle Jul 27, 2014 at 19:02 UTC - 0 likes

    @Lionhard98: Go

    Add a check if the percentage you set the boss bar to, is (lower than) 0. If so, set it to 1. =)

Facts

Date created
Sep 01, 2013
Category
Last update
Apr 19, 2014
Development stage
Release
License
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Curse link
BarAPI
Downloads
293,035
Recent files

Authors