Disguise a mob as a player

Discussion in 'Spigot Plugin Development' started by Alex0589, Jul 18, 2018.

  1. Hi spigot users,
    I'm currently working on a plugin and I want to add a command to spawn a disguised mob (you spawn a zombie that looks like a player). I already tried but it's not really working. CAn you jelp me? Thanks
     
  2. Yes sir i believe there is an issue in your code
     
  3. TheJavaHacker

    Supporter

    If you could, please show me your code so that I can have a look into what's going on in it. Please paste it in a hastebin, or preferrably a https://paste.md-5.net.
     
  4. At the moment I'm not on my pc, but can you please explain how I should do it ?
     
  5. TheJavaHacker

    Supporter

    Grab all of your code in each class using ctrl +a and then ctrl + c and then paste it in the link I sent using ctrl +v and then copy/paste the links to me either here or in PM.
     
    • Funny Funny x 1
  6. LOl not talking about that :LOL:. How fo you think I should disguise it
     
  7. TheJavaHacker

    Supporter

    Grab the Entity by it's UUID and change the Entity type whilst keeping it's UUID the same.
     
  8. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    You can't set an Entity's EntityType.

    You'll need to play around with packets a bit to spawn a player.
     
    • Agree Agree x 1
  9. TheJavaHacker

    Supporter

    What I mean by that is despawn the entity and spawn in a new one using the old entity's name and UUID.
     
  10. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Would be less buggy and more performance friendly to simply cancel packets for that entity and replace them with one for a player.
     
    • Agree Agree x 1
  11. How can I do that?
     
  12. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Use ProtocolLib to listen for packets and cancel them and send your own.
    If you'd like to learn more about packets, I'd start with the packet list maintained on wiki.vg: http://wiki.vg/Protocol
    Tons of useful information, I like to read it over occasionally.
     
    • Agree Agree x 1