Minecraft PC IP: play.cubecraft.net

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,166
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 profile posts

day #7 on the way to #100
1751326464917.png
Minor server update: CubeCraft replaced the emote stand with how to play in all game lobbies. Very nice QoL change for Bedrock. It's also added to the hotbar when you join the game, so now new players can walk up to it or use it while waiting for game to start to learn the game
HoppyFrog wrote on Flxen's profile.
Aww :(, sorry I'm late. Thanks for everything Flxen :despair:
AronTheLlama wrote on Kloska's profile.
quackadoodle
Mats3209 wrote on khco's profile.
hey khco havent seen you online in a while, hope everything is going great for you, hope to see you online some time, take care
Top Bottom