Advertisement
devconnn

Untitled

Nov 15th, 2014
218
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.IIxUnderWorldxII.pets;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.Material;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandExecutor;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.event.Listener;
  11. import org.bukkit.inventory.Inventory;
  12. import org.bukkit.inventory.ItemStack;
  13. import org.bukkit.inventory.meta.ItemMeta;
  14. import org.bukkit.plugin.java.JavaPlugin;
  15.  
  16.  
  17. public class Pets extends JavaPlugin implements CommandExecutor, Listener{
  18.  
  19.  
  20. public void onEnable(){
  21. getLogger().info("");
  22.  
  23. getServer().getPluginManager().registerEvents(this, this);
  24.  
  25. }
  26.  
  27.  
  28.  
  29. {
  30.  
  31. Inventory inv = Bukkit.createInventory(null, 9, ChatColor.GREEN + "[TEST]");
  32.  
  33. ItemStack cow_pet = new ItemStack(Material.MONSTER_EGG, 1);
  34. ItemMeta cow_petMeta = cow_pet.getItemMeta();
  35.  
  36. cow_petMeta.setDisplayName(ChatColor.AQUA + "Purchase Frozen Head");
  37. cow_pet.setItemMeta(cow_petMeta);
  38.  
  39. inv.setItem(2, cow_pet);
  40.  
  41. }
  42.  
  43.  
  44. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  45. Player p = (Player) sender;
  46.  
  47. if(cmd.getName().equalsIgnoreCase("pets")) {
  48. Inventory inv = null;
  49. p.openInventory(inv);
  50. p.sendMessage(ChatColor.DARK_AQUA + "[CS]" + ChatColor.WHITE + " Opening the CS Pet Menu");
  51.  
  52.  
  53.  
  54.  
  55. }
  56. return false;
  57.  
  58. }
  59.  
  60. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement