[Lib's Disguises] Possible to put name over player disguise?

Discussion in 'Plugin Development' started by unenergizer, May 31, 2014.

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

    unenergizer

    Hello everyone,

    I am wondering if anyone has any experience in using Lib's Disguises api to create player disguises. The author states on the main plugin page that he does not answer messages, so I will not message him. However if anyone else has experience with Lib's Disguises then I would appreciate the help!

    What I would like to do is to put the players name above the disguise that they have activated. This is mainly so we can catch cheerers in disguises. I have used the library to make a players disguise in my plugin, but I don't see a clear way on implementing a username above the players disguise.

    Thanks!
    -unenergizer

    Edit:
    I have googled for answers before coming here.
    I have read all the documentation the author provides on the plugin page.
     
    GrandmaJam likes this.
  2. Offline

    bensku

  3. Offline

    libraryaddict

    Eh.
    Re-enabled comments on the project.
    I mainly did it as I was pissed off at being told to remove my jenkins, repo and github as they were against bukkit rules.

    unenergizer
    The nametag that appears above a players head is the one used when you constructed a player disguise.
    As bensku mentioned, currently in 1.7.9 you can change skins and nametags seperately.
    However the problem exists that it looks to be 1.7.9 only. It will not work in older versions, and is likely to not work in newer versions.
    Which is why I have not added a easy to use API to do this.

    If you did however need to do that, you currently would need to use reflection to get the gameprofiles map.
    Then add the playername, and a gameprofile containing their name, their uuid and the skinblob you want used.
    The methods you are looking for are in DisguiseUtilities and ReflectionManager

    Alright.
    The latest development build and github now has setSkin.
    I can't link to it here, nor is it on the bukkitdev page, so you will need to look for Lib's Disguises jenkins. It should be fairly easy to find.
    I can't guarantee that setSkin will remain as its looks to be 1.7.9 only. But given that we will be on that version for some time and people want this.. Why not

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

    unenergizer


    Thank you for your help I do appreciate it. However I am only wanting to put names above a players "mob" disguise. For instance if a player turns into a creeper, zombie, ghast, wolf, etc they would have their player name above the mob's head. I have no need to change skins, this is not what I was looking for. I apologize if my first message was unclear.

    Thanks for the help!

    -unenergizer
     
  5. Offline

    libraryaddict

    unenergizer
    Eh.
    Code:
    ((LivingWatcher) disguise).getWatcher().setCustomName(player.getName());
    ((LivingWatcher) disguise).getWatcher().setCustomNameVisible(true);
     
    unenergizer likes this.
  6. Offline

    unenergizer

    Thank you libraryaddict. I appreciate your help and your plugin. Your plugin has saved me ton's of time and hard work and for that I can't say thank you enough. Give me a few days to get some money into paypal and I will gladly make a $15 donation to your server/projects/pizzaFund. Also I apologize if I have asked a stupid question. I know you can add custom names to mobs, but I didn't know the hierarchy of this plugin. Also, the plugins listed on your page that use this, also don't have active player names. I was gonna just decompile their plugins and see how they did it, but neither of them had mob's with player names. I honestly did put forth the effort to try and figure it out on my own before asking! I promise!

    -unenergizer from Texas!
     
  7. Offline

    TedTheTechie


    libraryaddict

    How would I use this exactly? (Sorry if im bumping a old post)
     
  8. Offline

    libraryaddict

    wat.
    Look in the code quote.
     
Thread Status:
Not open for further replies.

Share This Page