Setting Skull's Owner

Discussion in 'Resources' started by Panjab, Jan 3, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Panjab

    Here's a simply method to set an owner of any skull you got. I don't know exactly but it should work with every skull. ;)

    Code:java
    1.  
    2. // Command Stuff
    3.  
    4. Block block = player.getBlockAt();
    5.  
    6. if (block.getType() == Material.SKULL) {
    7. CraftSkull skull = new CraftSkull(block);
    8. skull.setOwner(args[0]); // args[0] is a player's name -> /head <name>
    9. skull.update();
    10. sender.sendMessage(ChatColor.GREEN + "You successfully changed the owner of this skull!");
    11.  
    12. }
     
  2. CraftSkull isnt importable for me! Using craftbukkit.
     
  3. Offline

    jbman223

    It was added in the 1.4.6 API, so you need to be using the latest beta build in order to use it, the latest recommended build will not have it. To find other versions, go to dl.bukkit.org
     
  4. I found another better way ;) Thx for your help
     
Thread Status:
Not open for further replies.

Share This Page