-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathText Sending Plugin
43 lines (38 loc) · 1.14 KB
/
Text Sending Plugin
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 network.battlecraft.winglessentialstest;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
//server on
}
@Override
public void onDisable() {
//server off
}
// /truth = response of "Successful Text"
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (label.equalsIgnoreCase("truth")) {
if (sender instanceof Player) {
//player (not console)
Player player = (Player) sender;
if (player.hasPermission("winglessentials.test.use")) {
player.sendMessage(ChatColor.LIGHT_PURPLE+""+ChatColor.BOLD+"Successful Text");
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&eIt Worked"));
return true;
}
player.sendMessage(ChatColor.DARK_RED+""+ChatColor.BOLD+"You don't Have permission to use this!");
return true;
}
else {
//console (not player)
sender.sendMessage("Hello console user!");
return true;
}
}
return false;
}
}