Player heads bug?

Discussion in 'Plugin Development' started by viper_monster, May 29, 2014.

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

    viper_monster

    Hey! I'm not sure if this is bug with Bukkit or it's just me being stupid.

    This is the code I have:
    Code:java
    1. @EventHandler
    2. public void onPlayerDeath(PlayerDeathEvent event) {
    3. Player player = event.getEntity();
    4.  
    5. ItemStack itemStack = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
    6. SkullMeta meta = (SkullMeta) itemStack.getItemMeta();
    7.  
    8. meta.setOwner(player.getName());
    9. player.sendMessage(meta.getOwner());
    10. meta.setDisplayName("§c" + player.getName() + "'s head");
    11. itemStack.setItemMeta(meta);
    12.  
    13. player.getWorld().dropItemNaturally(player.getLocation(), itemStack);
    14. }


    The problem is, when I place that head on the ground, it doesn't have a skin, it's just the default Steve's skin.

    btw, meta.getOwner() is returning the proper name

    Bump? :rolleyes:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
  2. Offline

    Monkey_Swag

    A bit after the whole UUID thing was announced I saw multiple head plugins getting bugs. I have no idea if it is because of the new UUID system. Again, I play on a server that has a plugin like this and it gives the correct name but steve skin
     
  3. Offline

    viper_monster

  4. Offline

    Monkey_Swag

    viper_monster no idea, all I know is that it Can't be something wrong with your code.
     
  5. Offline

    viper_monster

    I don't believe no one knows what's the cause of this...

    Necrodoom I have tested it with UUID.toString() but it didn't work :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
  6. Offline

    NoChanceSD

    viper_monster I believe it was something Mojang changed which made it stop working.
    The biggest plugins using player heads don't have a fix for it yet so i'm guessing there isn't one... not sure though.
     
  7. Offline

    AronTheGamer

    Make an Itemstack and give it the new datatags via NBT
     
  8. Offline

    viper_monster

    AronTheGamer NoChanceSD Well, looks like I will have to wait for Bukkit to make a workaround cause I don't wan't to mess with NMS :p Thanks for replying :)
     
Thread Status:
Not open for further replies.

Share This Page