DerAlexander

plin Ale zur problembehandlun

Mar 24th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.51 KB | None | 0 0
  1. public class BugPluginClass1 extends JavaPlugin {
  2.  
  3.     @Override
  4.     public void onEnable() {
  5.        
  6.         String NameDesPlugins = this.getDescription().getName();
  7.        
  8.         super.onEnable();
  9.        
  10.         System.out.println("TESTAUSGABE Plugin " + NameDesPlugins + " 1.0.0 geladen.");
  11.     }
  12.    
  13.     public static void wartemal(long millis) {
  14.         try {
  15.             Thread.sleep(millis);
  16.         } catch (InterruptedException e) {}
  17.     }
  18.    
  19.     @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
  20.  
  21.    
  22.          Player player = null ;
  23.          if(sender instanceof Player) {
  24.              player = (Player) sender;
  25.          }
  26.          
  27.          //Kommandos
  28.  
  29.          //Kommando Paintballs
  30.          if(cmd.getName().equalsIgnoreCase("pbTB")){
  31.                
  32.                
  33.                 if (player == null) {
  34.                    
  35.                     sender.sendMessage("Sorry, this only works ingame!");
  36.                     return true;
  37.                    
  38.                    
  39.                 } else {
  40.                     player.sendMessage(ChatColor.GREEN + "[PB]" + ChatColor.YELLOW +"Paintball InvLoad Started!");
  41.                     //wartemal(3000);
  42.                     ItemStack item = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
  43.                     ItemMeta met =item.getItemMeta();
  44.                     met.setDisplayName("TeamBlau");
  45.                     item.addEnchantment(Enchantment.BINDING_CURSE, 1);
  46.                     LeatherArmorMeta brustMeta = (LeatherArmorMeta)item.getItemMeta();
  47.                     brustMeta.setColor(Color.BLUE);
  48.                     item.setItemMeta(met);
  49.                     player.getInventory().setChestplate(item);
  50.                     //wartemal(3000);
  51.                     ItemStack PBB = new ItemStack(Material.SNOW_BALL, 32);
  52.                    
  53.                    
  54.                 }
  55.                     return false;
  56.                
  57.                 }
  58. }
Add Comment
Please, Sign In to add comment