Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 26th, 2012  |  syntax: JavaScript  |  size: 1.38 KB  |  hits: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package me.Rudolfchamp.Equipment;
  2.  
  3.  
  4. import javax.swing.Spring;
  5.  
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.inventory.ItemStack;
  10. import org.bukkit.plugin.java.JavaPlugin;
  11.  
  12.  
  13.  
  14. public class Equipment extends JavaPlugin {
  15.  
  16.  
  17.         @Override
  18.         public void onDisable() {
  19.                 System.out.println("[Equipment] Das Plugin ist deaktiviert!");
  20.         }
  21.        
  22. @Override
  23. public void onEnable() {
  24.         System.out.println("[Equipment] Das Plugin ist aktiviert!");
  25.         }
  26.        
  27.  
  28.         public boolean onCommand (CommandSender sender, Command cmd, Spring label, String[] args) {
  29.  
  30.                 if (cmd.getName().equalsIgnoreCase("equip")) {
  31.                         if (args.length == 0) {
  32.                                 if (!(sender instanceof Player)) {
  33.                                         System.out.println("Dieser Befehl ist nur für Spieler!");
  34.                                         return true;
  35.                                 }
  36.                                 Player player = (Player) sender;
  37.                                         player.getInventory().setHelmet(new ItemStack (310, 1));
  38.                                         player.getInventory().setChestplate(new ItemStack (311, 1));
  39.                                         player.getInventory().setLeggings(new ItemStack (312, 1));
  40.                                         player.getInventory().setBoots(new ItemStack (313, 1));
  41.                                 return true;
  42.                         }
  43.                                 if (args.length>0) {
  44.                                 return false;
  45.                         }
  46.         }
  47.                         return false;
  48.         }
  49. }