Advertisement
JakeDGator

RcSlap

Aug 10th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.75 KB | None | 0 0
  1. package me.JakeDGator.RcSlap;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. //###Developer Notes##
  11. //RcPing is a custom made plugin to test lag for REALMCRAFT Revised (http://www.mcrealm.net)
  12. //How versions work: Each change to a plugin that is small, counts as + 0.0.1, which I start out with 1.0.0
  13. //Example: If I want to fix a error message, that would count as one. Also if I changed a permission node, that would be one.
  14. //So the version would be 1.0.2, and the scale goes up to 10, so it would not be 1.0.10, but 1.1.0
  15.  
  16.  
  17. public class Main extends JavaPlugin{
  18.  
  19.     public void onEnable(){
  20.         getLogger().info("RcSlap V.1.0.0 has been Enabled");
  21.     }
  22.    
  23.     public void onDisable(){
  24.         getLogger().info("RcSlap V.1.0.0 has been Disabled");
  25.     }
  26.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  27.         // Telling that a command is coming up, inside these new { brackets, stuff for the command happens
  28.         @SuppressWarnings("deprecation")
  29.         Player target = (Bukkit.getServer().getPlayer(args[0]));
  30.         if(sender instanceof Player) {
  31.             Player player = (Player) sender;
  32.             if(cmd.getName().equalsIgnoreCase("slap" + target)){
  33.                 String slap = "msg " + player + ChatColor.AQUA + " You were slapped by " + player + ChatColor.RED + " and enjoyed it :D";
  34.                 Bukkit.dispatchCommand(Bukkit.getConsoleSender(), slap);
  35.                 player.sendMessage(ChatColor.YELLOW + "You slapped " + ChatColor.GOLD + player + " and they enjoyed it >:)");
  36.  
  37.             }
  38.         }
  39.        
  40.         return false;
  41.     }
  42.    
  43.    
  44.    
  45. }
  46. //Copyright 2014 REALMCRAFT Revised (http://www.mcrealm.net) All rights reserved. Author: JakeDGator
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement