-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBossBar.java
More file actions
43 lines (35 loc) · 1.21 KB
/
BossBar.java
File metadata and controls
43 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package me.UaVxChallenge.BarUpdate;
import java.util.logging.Logger;
import me.confuser.barapi.BarAPI;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
public class BarUpdate extends JavaPlugin {
public final Logger logger = Logger.getLogger("Minecraft");
public static BarUpdate plugin;
@Override
public void onDisable() {
PluginDescriptionFile pdfFile = this.getDescription();
this.logger.info(pdfFile.getName() + pdfFile.getVersion() + " Has been Disabled!");
}
@Override
public void onEnable() {
PluginDescriptionFile pdfFile = this.getDescription();
this.logger.info(pdfFile.getName() + pdfFile.getVersion() + " Has been Enabled!");
}
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (label.equalsIgnoreCase("ShowBar")){
BarAPI.setMessage((Player)sender,ChatColor.RED + "The bar is now visible", 100f);
}
if(label.equalsIgnoreCase("Hidebar")){
if(BarAPI.hasBar((Player) sender)){
BarAPI.removeBar((Player) sender);
}
}
return false;
}
}