Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.JakeDGator.RcSlap;
- import org.bukkit.Bukkit;
- 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;
- //###Developer Notes##
- //RcPing is a custom made plugin to test lag for REALMCRAFT Revised (http://www.mcrealm.net)
- //How versions work: Each change to a plugin that is small, counts as + 0.0.1, which I start out with 1.0.0
- //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.
- //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
- public class Main extends JavaPlugin{
- public void onEnable(){
- getLogger().info("RcSlap V.1.0.0 has been Enabled");
- }
- public void onDisable(){
- getLogger().info("RcSlap V.1.0.0 has been Disabled");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- // Telling that a command is coming up, inside these new { brackets, stuff for the command happens
- @SuppressWarnings("deprecation")
- Player target = (Bukkit.getServer().getPlayer(args[0]));
- if(sender instanceof Player) {
- Player player = (Player) sender;
- if(cmd.getName().equalsIgnoreCase("slap" + target)){
- String slap = "msg " + player + ChatColor.AQUA + " You were slapped by " + player + ChatColor.RED + " and enjoyed it :D";
- Bukkit.dispatchCommand(Bukkit.getConsoleSender(), slap);
- player.sendMessage(ChatColor.YELLOW + "You slapped " + ChatColor.GOLD + player + " and they enjoyed it >:)");
- }
- }
- return false;
- }
- }
- //Copyright 2014 REALMCRAFT Revised (http://www.mcrealm.net) All rights reserved. Author: JakeDGator
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement