Answers for "send message as player spigot"

2

send message to all player java spigot

for (Player p : Bukkit.getOnlinePlayers()) {
    p.sendMessage("");
}
Posted by: Guest on May-04-2021
0

Spigot coding how to send a message to player after commadn

//After Command
public boolean onCommand(CommandSender sender, Command cmd, String[] args, String tag) {
	if(tag.equals("test")) {
    	Player player = (Player)sender; //getting the player reference
        player.sendMessage("Hello World!"); 
    	return true;
    }
    return false;
}
Posted by: Guest on October-06-2020

Code answers related to "send message as player spigot"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language