Created
May 5, 2017 13:02
-
-
Save Ebycow/7fad2966c2f8ea6fdd3afba76a0eb374 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
@Override | |
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | |
if (command.getName().equalsIgnoreCase("head")) { | |
Player player = (Player) sender; | |
ItemStack headItem = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal()); | |
SkullMeta itemMeta = (SkullMeta) headItem.getItemMeta(); | |
itemMeta.setOwner(sender.getName()); | |
headItem.setItemMeta(itemMeta); | |
player.getInventory().addItem(headItem); | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment