change player name

Discussion in 'Plugin Development' started by Cat 700, Jul 14, 2019.

  1. Offline

    Cat 700

    how would I change the player name (I don't want to use teams I am also using 1.8 and don't know if it has teams but I am pretty sure it does and I would rather not use another plugin for changing the name) I would like to change their name in everything in tab chat and above them
     
  2. Offline

    KarimAKL

    @Cat 700 You could change the name using their GameProfile, though that would require reflection and then Player#getName() would return your changed value. (in case you go this way, i think the field is 'name')
     
  3. Offline

    Cat 700

    Could you show me a example
     
  4. Offline

    KarimAKL

  5. Offline

    Cat 700

    Ok will try and use that
     
  6. Offline

    Cat 700

    how would I change the player name if I was to use scoreboards and not game profile or just what is a easier way
     
  7. Offline

    KarimAKL

    @Cat 700 I'm not sure, i haven't worked much with scoreboards. :7 Try looking up some scoreboard tutorials.
     
  8. Offline

    Cat 700

    @KarimAKL I can't figure out how to change the name of a game profile and nothing else how would I do that
     
  9. Offline

    KarimAKL

    @Cat 700 What have you tried so far?
     
  10. Offline

    Cat 700

    Nothing because I can't find anything that goes just in the plugin to change the name
     
  11. Offline

    CraftCreeper6

    I'm not really sure what you're after but why can't you just use player#setDisplayName()

    Sent from my LYA-L09 using Tapatalk
     
  12. Offline

    Cat 700

    @CraftCreeper6 I can is it not player.setdisplayname? Also I have tried that and it does not work (for me at least have not tried other people looking at my username) and I also want to try using game profiles
     
    Last edited: Jul 16, 2019
  13. Offline

    KarimAKL

    I don't think that changes the name tag, only the chat name, and then you can use Player#setPlayerListName for the tab list, but there's nothing about the name tag. (at least from what i can see)
    What do you mean?
     
  14. Offline

    CraftCreeper6

    @Cat 700 @KarimAKL
    Use player#setDisplayName(), then update player#setPlayerListName() with player#getDisplayName(), create a new scoreboard for above the players head and also use player#getDisplayName() to show it.

    What's wrong with this approach?
     
    KarimAKL likes this.
  15. Offline

    KarimAKL

    @CraftCreeper6 I didn't say anything was wrong with it but as i said earlier:
    So i wouldn't know about the scoreboard part. :p
     
  16. Offline

    CraftCreeper6

    @KarimAKL
    Was more focused on the OP :p Only tahg'd you to let you know what I was talking about :p

    The method I was going for wouldn't work well anyway. It would still display the players name as is; just with something else below it.

    I think the OP will have to go will have to go with @KarimAKL's method of GameData. I found a util for it but it only works for 1.8. It can be found here

    Good luck.
     
  17. Offline

    Cat 700

    Sorry for not replying to anything on vacation I tried player.setdisplayname but that didn't work but not the way you said I also was gonna try player. Setcustomname but I will try your way I would still like to know how to make a gameprofile for NPC's because I think they need them but I haven't done much with NPC's and @KarimAKL when you said what do you mean to my last post what I meant was I haven't found anything other than chaning the skin but that takes a website and @CraftCreeper6 can I still use scoreboards teams to make a prefix/suffix
     
    Last edited: Jul 17, 2019
  18. Offline

    KarimAKL

    1. Changing the skin doesn't require reflection, but changing the name does, that's probably why you've only found that.
    2. Changing the skin doesn't require any URL, you can set the textures to another player's textures.
     
  19. Offline

    CraftCreeper6

  20. Offline

    Cat 700

    Thanks will do some of my own research as well but that doesn't normally find me much

    If I was using protocollib could I use packets to change the name and if so how?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 18, 2019

Share This Page