I've been messing with the boss bars and after not getting them to work, I've resorted to using a plugin and then making another plugin that makes the player say commands from it. I'm aware this is extremely inefficient and I really don't want to do it like this, however I don't know how to do it otherwise. Here is what I have: Code:java package me.maxben34.boss; import org.bukkit.Bukkit;import org.bukkit.entity.Player;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.player.PlayerJoinEvent;import org.bukkit.plugin.java.JavaPlugin; public class boss extends JavaPlugin implements Listener{ public void onEnable(){ Bukkit.getServer().getPluginManager().registerEvents(this, this); } public void Boss(){ for(final Player p : Bukkit.getOnlinePlayers()){ Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){ public void run(){ p.chat("/bm 1 &9&lProjectMayhem");}},20); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){ public void run(){ p.chat("/bm 1 &d&lProjectMayhem");}},20); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){ public void run(){ p.chat("/bm 1 &a&lProjectMayhem");}},20); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){ public void run(){ p.chat("/bm 1 &c&lProjectMayhem");}},20); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){ public void run(){ p.chat("/bm 1 &b&lProjectMayhem");}},20); }} @EventHandler public void onPlayerJoin(final PlayerJoinEvent e){ Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){ public void run(){ Boss(); } ;}, 20, 6*20);} } Right now this isn't currently working I can't seem to figure out why. Maybe you guys could help, or just tell me how to do this without any other plugins (as I said it's really stupid how I have it right now). Although I was having trouble doing it without a plugin before. Bump :/ EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Try changing the Code:java 20 at the end of each line so that it goes from maybe 20 to 40 to 60 etc. Other than that I'm not totally sure Good luck
Boss bars? You mean like the health bar of the enderdragon and wither? https://forums.bukkit.org/threads/tutorial-utilizing-the-boss-health-bar.158018/
By the way, see how you are doing: Code:java p.chat("/bm 1 &b&lProjectMayhem");}},20); and such? What if the player's command key is not a "/"? I would recommend changing it to: Code:java Bukkit.getServer().dispatchCommand(p, "command");
negative_codezZ You are so lost. A command key doesn't change based on the client...... You also cannot change the command key you use. Please. If you don't know the material yourself don't go around telling people how to improve.
Regardless of his reasoning, it is really still better to use .dispatchCommand(), as it won't be influenced by chat plugins which could otherwise interfere.