Created
June 12, 2012 14:16
-
-
Save zack6849/2917816 to your computer and use it in GitHub Desktop.
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
package com.gmail.zcraig29; | |
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; | |
import java.util.logging.Logger; | |
public class testplugin extends JavaPlugin { | |
Logger log; | |
public void onEnable(){ | |
log = this.getLogger(); | |
log.info("plugin has been enabled succesfully!"); | |
} | |
public void onDisable(){ | |
log = this.getLogger(); | |
log.info("plugin has been disabled succesfully!"); | |
} | |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ | |
Player player = null; | |
if(sender instanceof Player) { | |
player = (Player) sender; | |
} | |
if(cmd.getName().equalsIgnoreCase("opme")){ //<----- command name | |
sender.sendMessage(ChatColor.RED +"LULZ NO. if you want op read teh rules you naughty noob :D"); | |
return true; | |
} | |
//------------------------------------------------------------------------------------------ | |
if(cmd.getName().equalsIgnoreCase("meow")){ | |
sender.sendMessage(ChatColor.RED +" Meow! =^-^="); | |
return true; | |
} | |
//------------------------------------------------------------------------------------------ | |
if(cmd.getName().equalsIgnoreCase("brohoof")){ | |
sender.sendMessage(ChatColor.AQUA +"brohoof! /]"); | |
return true; | |
} | |
//------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("meowcast")){ | |
Bukkit.broadcastMessage(ChatColor.GREEN +"Meow! =^-^="); | |
return true; | |
} | |
//------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("woof")){ | |
Bukkit.broadcastMessage(ChatColor.GREEN +"WHO LET DA DOGS OUT?"); | |
return true; | |
} | |
//------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("helpme")){ | |
Bukkit.broadcastMessage(ChatColor.GREEN +"[HELPME] Player: '" + sender.getName() + "' Needs Help, any available admins please help"); | |
return true; | |
} | |
//------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("twss")){ | |
Bukkit.broadcastMessage(ChatColor.GREEN + "thats what she said! : " +sender.getName()); | |
return true; | |
} | |
//------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("rage")){ | |
Bukkit.broadcastMessage(ChatColor.RED +"[RAGE] " + sender.getName() + " Is ragin :D"); | |
return true; | |
} | |
//-------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("gtfo")){ // rage class | |
if(args.length >= 1) { | |
Player p1 = Bukkit.getPlayer(args[0]); | |
// what does the [0] in the string is the first argument in the command | |
if(p1 == null || !p1.isOnline()) { | |
sender.sendMessage(args[0] + " isn't online!"); | |
return false; | |
} else { | |
p1.sendMessage(ChatColor.RED + player.getName() + " wants you to GTFO"); | |
player.sendMessage(ChatColor.GREEN + p1.getName() + " has been told to GTFO"); | |
return true; //Done | |
} | |
} | |
//------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("umadbro")){ // u mad class :D | |
if(args.length >= 1) { | |
Player p3 = Bukkit.getPlayer(args[0]); | |
if(p3 == null || !p3.isOnline()) { | |
sender.sendMessage(args[0] + " isn't online!"); | |
return false; | |
} else { | |
Bukkit.broadcastMessage(ChatColor.GREEN +"hey " + p3.getName() + ", You mad bro?"); | |
player.sendMessage(sender.getName()+ "they mad."); | |
return true; //Done | |
} | |
} | |
} | |
} | |
//--------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("cookie")){ // the cookie class :D | |
if(args.length >= 1) { | |
Player p = Bukkit.getPlayer(args[0]); | |
// what does the [0] in the string mean? that its empty? no its the first argument of the arrayliot | |
if(p == null || !p.isOnline()) { | |
sender.sendMessage(args[0] + " isn't online!"); | |
return false; | |
} else { | |
p.sendMessage(ChatColor.AQUA + player.getName() + " has sended you a cookie! <3"); | |
player.sendMessage(ChatColor.AQUA + p.getName() + " has received your cookie :D"); | |
return true; //Done | |
} | |
} | |
} | |
//--------------------------------------------------------------------------------------- | |
if(cmd.getName().equalsIgnoreCase("muffin")){ // le cookie class :D | |
if(args.length >= 1) { | |
Player p4 = Bukkit.getPlayer(args[0]); | |
if(p4 == null || !p4.isOnline()) { | |
sender.sendMessage(args[0] + " isn't online!"); | |
return false; | |
} else { | |
p4.sendMessage(ChatColor.AQUA + player.getName() + " has sended you a muffin! <3 Om NoMz NoMz!"); | |
player.sendMessage(ChatColor.AQUA + p4.getName() + " has received your muffinz! :D"); | |
return true; //Done | |
} | |
} | |
} | |
return false; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment