Minecraft PC IP: play.cubecraft.net

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,165
518
Kepler-452b
Hello, this will be a group of medium level bukkit/spigot tutorials (no video). This is for broadcasts:

I assume you have alredy created the onCommand method
Code:
 public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
And created your player
Code:
        Player player = (Player)sender;

Now we need to create two ints and a string
Code:
int laengeArray = args.length;
            int indexArray = 0;
            String text = "";

Now we need to get the lenght and use the String that we named "text":
Code:
            for (int i = 0; i < args.length; i++) {
                text = text + args[i] + " ";
            }

Now the message. Here we will use bukkit one.
Code:
        Bukkit.broadcastMessage(ChatColor.DARK_RED + "[Alert] " + ChatColor.RED + text);


I'm noob explaining in text. I know
 
  • Like
Reactions: Buuuddy
Members Online

Members online

Latest posts

Latest profile posts

UncleSpect wrote on xSchulzis's profile.
Hiiii xSchulzis! :D
UncleSpect wrote on Roxlad's profile.
Happy birthday! 🎈
UncleSpect wrote on WolfX's profile.
Happy birthday! 🎈
UncleSpect wrote on Ferrcho's profile.
Happy birthday! 🎈
Heya, after a good while years having not appreciated sleep a lot, have I learned things. I have most of the times seen it as a hindrance to things such as relations and projects. But after years I realised that you need to sleep to be well. Both physically and mentally. When I also realized that I could work better and more efficiently, did I try to get more sleep. That reminds me, I need to sleep now hah XD
Top Bottom