SHARE
TWEET

Untitled

a guest Sep 20th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package de.Tommunity.Commands;
  2.  
  3. import org.bukkit.Material;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.inventory.ItemStack;
  9. import org.bukkit.inventory.meta.SkullMeta;
  10.  
  11. import de.Tommunity.Main.Main;
  12.  
  13. public class Kopf implements CommandExecutor{
  14.  
  15.     @Override
  16.     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  17.         if(!(sender instanceof Player)) {
  18.             sender.sendMessage(Main.pre + "§cDazu musst du ein Spieler sein!");
  19.         }
  20.         Player p = (Player) sender;
  21.         if(!p.hasPermission("Tom.Kopf")) {
  22.             p.sendMessage(Main.pre + "§cDazu hast du keine Rechte!");
  23.         }
  24.        
  25.        
  26.         if(args.length == 1) {
  27.             ItemStack is = new ItemStack(Material.SKULL_ITEM, 1 , (short) 3);
  28.             SkullMeta im = (SkullMeta)is.getItemMeta();
  29.             im.setOwner(args[0]);
  30.             im.setDisplayName(args[0]);
  31.             is.setItemMeta(im);
  32.             p.getInventory().addItem(new ItemStack[] {is});
  33.             p.updateInventory();
  34.             p.sendMessage("§3Du hast den Kopf von §6" + im.getDisplayName() + " §3 bekommen");
  35.             return true;
  36.             }else {
  37.                 p.sendMessage("§cBitte benutze §6/kopf <Spieler>");
  38.             }
  39.                
  40.            
  41.                    
  42.        
  43.        
  44.        
  45.        
  46.        
  47.         return false;
  48.     }
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top