Disable heads on TAB

Discussion in 'Plugin Development' started by drafix, Jul 5, 2019.

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

    drafix

  2. Online

    KarimAKL

    @drafix I don't think it's possible to remove the heads.
     
  3. Offline

    drafix

    @KarimAKL how to change? Because it can be changed for sure.
     
  4. Online

    KarimAKL

    @drafix To change it, i think you would have to change the skin of the player (or NPC), you can do that by editing their GameProfile, this requires you to get the player (or NPC) used.
     
  5. Offline

    drafix

    @KarimAKL What game profile? Where to get it?
     
  6. Online

    KarimAKL

    @drafix You can get a player's GameProfile by using EntityPlayer#getProfile()
    This is using NMS of course. Let me know if you don't know what NMS is.
     
  7. Offline

    drafix

    I still do not know how to do it :(
    I want to change the heads themselves for the logo, because they are all over TAB, and I do not want them.
     
  8. Online

    KarimAKL

  9. Offline

    drafix

    I do not understand how to do it with this NMS ... :(
     
  10. Online

    KarimAKL

    @drafix What exactly don't you understand about it? To get the GameProfile you need to use EntityPlayer#getProfile(), and to get the EntityPlayer you need to get the CraftPlayer and use CraftPlayer#getHandle().
    Let me know if you've got the GameProfile, then i'll move on to how you can edit the skin.

    Tip: CraftPlayer implements Player.
     
  11. Offline

    drafix

    CraftPlayer cp = (CraftPlayer) p;
    EntityPlayer ep = cp.getHandle();
    GameProfile gp = ep.getProfile();

    well? @KarimAKL
     
  12. Online

    KarimAKL

    @drafix Good, now you can get the textures of a player by getting the PropertyMap (getProperties) from the profile and then get 'textures'. Set the textures the same way.
    You can get the player you want a skin from, get their profile, get their textures and then set your player (NPC)'s textures to that.
     
  13. Offline

    drafix

    PropertyMap pm = gp.getProperties();

    I have these PropertyMap, but how do you set these textures and so on?
     
  14. Online

    KarimAKL

    @drafix Something like this should work:
    Code:Java
    1. gp.getProperties().put("textures", yourPlayer.getProfile().getProperties().get("textures"));
     
  15. Offline

    drafix

  16. Online

    KarimAKL

    What's not working? What happens? Could you elaborate?
     
  17. Offline

    drafix

    @KarimAKL Still the heads on TAB are as they were, there are no errors.
     
  18. Online

    KarimAKL

    @drafix Are you getting the NPC in the tab and then setting the skin for that NPC?
     
  19. Offline

    drafix

    How to get this NPC? :confused:
     
  20. Online

    KarimAKL

    @drafix Where do you get 'p'? The player you are changing the skin for.
     
  21. Offline

    drafix

    Player p = e.getPlayer();
    How to get NPC player?
     
  22. Online

    KarimAKL

    @drafix
    1. You are setting the player's skin, not the NPC's skin.
    2. I don't know, do you create the NPCs yourself? If not, then maybe you can get them from WorldServer#players (WorldServer is the NMS version of World from Bukkit)
     
Thread Status:
Not open for further replies.

Share This Page