2 Commits
2 changed files with 12 additions and 4 deletions

No files matched your search

+1
View File
@@ -5,6 +5,7 @@ main: plugin.mrtransistor.AFK.AFK
commands:
AFKUtils:
usage: "Usage: /afkutils controlbot <name>"
description: "Allows players to control bots"
spawnBot:
usage: "Usage: /spawnbot <name>"
description: "Spawns an EntityPlayer, that can be controlled from within the plugin and acts as a player, allowing loading mobs and random ticking"
@@ -18,6 +18,7 @@
*/
package plugin.mrtransistor.AFK.commands;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -41,10 +42,16 @@ public class SpawnBot implements TabExecutor {
if (!DummyPlayer.dummyNames.contains(args[0])) {
DummyPlayer dummy = DummyPlayer.spawnBot(args[0], ((Player) sender).getLocation(), (Player) sender);
sender.sendMessage("Bot '" + ChatColor.DARK_GREEN + args[0] + ChatColor.RESET + "' with UUID:["
+ ChatColor.GOLD + dummy.getUniqueIDString() + ChatColor.RESET + "] spawned");
}
else {
String json = "[{\"text\":\"Bot '\", \"color\":\"white\"}," +
"{\"text\":\"" + dummy.getName() + "\", \"color\":\"dark_green\"}," +
"{\"text\":\"' with UUID:[\", \"color\":\"white\"}," +
"{\"text\":\"" + dummy.getUniqueIDString() + "\", \"color\":\"gold\"," +
" \"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"" + dummy.getUniqueIDString() + "\"}," +
" \"hoverEvent\":{\"action\":\"show_text\", \"value\":\"Click to copy to clipboard\"}}," +
"{\"text\":\"] spawned\", \"color\":\"white\"}]";
Bukkit.dispatchCommand(sender, "tellraw " + sender.getName() + " " + json);
} else {
sender.sendMessage(ChatColor.RED + "Bot with name '" + ChatColor.DARK_GREEN + args[0] + ChatColor.RED + "' already exists");
}
return true;