[NMS] Assigning player head to custom entity?

Discussion in 'Plugin Development' started by valon750, Aug 29, 2014.

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

    valon750

    Afternoon all,

    I'm messing around with entities, especially with the player heads I can apply to them, however it seems that setting the SkullOwner will always result in Steve, regardless of what is entered.

    Now I came across a post somewhere else in the vastness of the internet, that explained that whilst in game, placing the named head then breaking it, will give it the new information needed (uuid, amongst other information), which seems to do the trick.

    However, I wouldn't know where to start when it comes to applying this with code. I've tried using both the players actual name, followed by their uuid, however neither had returned successful.

    Has anyone else needed to tackle a problem such as this?
     
  2. Offline

    Jimfutsu

    From what I heard, I do not actually know if this is true, heads always show up as Steve if you are in 1.7.2 - 1.7.5, but, 1.7.8 seems to fix this bug. As stated before, I have never tested this, but from what I heard, that seems to be the trick.
     
  3. Offline

    FabeGabeMC

    valon750
    Did you set the item meta to the skull?
     
  4. Offline

    valon750

    Jimfutsu

    I did consider this possibility, however I happen to be running a 1.7.9 version of the server, as well as 1.7.9 for the client, which should rule it out.

    Like I said said earlier, if I had the physical head, place it, then break it, I receive a new ItemStack with the correct info, but since I need it through code... Bleugh.

    Thank you though, glad we can rule this possibility out :)

    FabeGabeMC

    I most definitely set the ItemMeta.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  5. Offline

    Jimfutsu

    valon750
    Well, as you said if the item is placed, then broken, it gives the correct item meta. What if you placed the head, right underneath the player, then broke the item. Wouldn't the player pick the item up with the correct information?

    I do realize this probably isn't what your looking for
     
  6. Offline

    valon750

    Jimfutsu

    Such a workaround is possible, however it would be such a long winded approach to something that should really be possible with the one line.

    May I also note that what you're referring to as a "Player", is actually a custom Entity
     
  7. Offline

    Jimfutsu

    Yeah, sorry I just forgot normally work with players, I don't really use custom entities unless I have to.
     
  8. Offline

    valon750

Thread Status:
Not open for further replies.

Share This Page