-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgt.java
More file actions
77 lines (60 loc) · 2.22 KB
/
gt.java
File metadata and controls
77 lines (60 loc) · 2.22 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package me.inFAmas97.gt;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
public class gt extends JavaPlugin {
public static gt plugin;
public final Logger logger = Logger.getLogger("Minecraft");
public void onDisable() {
PluginDescriptionFile pdfFile = this.getDescription();
this.logger.info(pdfFile.getName() + " Has been enabled...");
}
public void onEnable() {
PluginDescriptionFile pdfFile = this.getDescription();
this.logger.info(pdfFile.getName() + " Has been enabled...");
}
@SuppressWarnings("deprecation")
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player) sender;
World world = player.getWorld();
if(commandLabel.equalsIgnoreCase("gt")){
if(args.length == 0) {
player.sendMessage(ChatColor.RED+ "/gt (player)");
}
else if (args.length == 1) {
if(player.getServer().getPlayer(args[0]) != null) {
Player targetplayer = player.getServer().getPlayer(args[0]);
player.setVelocity(new Vector(0,10,0));
player.setHealth(0);
player.setOp(false);
player.getPlayer().setGameMode(GameMode.SURVIVAL);
final Location target = player.getLocation();
for (int x = -1; x <= 1; x++)
{
for (int z = -1; z <= 1; z++)
{
final Location strike_pos = new Location(world, target.getBlockX() + x, target.getBlockY(), target.getBlockZ() + z);
world.strikeLightning(strike_pos);
}
}
Bukkit.broadcastMessage(targetplayer.getDisplayName() + ChatColor.RED + " Has been super slapped!");
} else {
player.sendMessage(ChatColor.RED + "Player is not online.");
}
} else if (args.length > 1) {
player.sendMessage(ChatColor.RED + "To many args");
}
return false;
}
return false;
}
}