-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5942720
commit 52d3d59
Showing
5 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/elementalmp4/command/admin/SmiteCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package main.java.elementalmp4.command.admin; | ||
|
||
import main.java.elementalmp4.SebUtils; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
public class SmiteCommand implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender commandSender, Command command, String alias, String[] args) { | ||
if (args.length == 0) { | ||
commandSender.sendMessage(ChatColor.RED + "You must specify a player!"); | ||
return true; | ||
} | ||
|
||
Player player = SebUtils.getPlugin().getServer().getPlayer(args[0]); | ||
if (player == null) { | ||
commandSender.sendMessage(ChatColor.RED + "Player could not be found!"); | ||
return true; | ||
} | ||
player.getWorld().strikeLightning(player.getLocation()); | ||
player.setHealth(0); | ||
commandSender.sendMessage(ChatColor.YELLOW + player.getName() + ChatColor.RED + " has been smited"); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters