1

I'm creating a bukkit plugin that's making a world in Minecraft outside the ordinary and that includes having NPCs (bots) entities that look like actually players and not villagers. I've already got the bots working programming wise but I want to have each bot have a different skin based upon it's name. Can I do this with maybe a resource pack or something? currently they take the names of Minecraft players with the same name but I'd like to override this.

TL;DR

Can I change the appearance of player entities by name with:

a Resourcepack?

a server side command?

playerConnection.sendPacket?

Jojodmo
  • 23,357
  • 13
  • 65
  • 107
Tony
  • 734
  • 4
  • 19
  • 37

2 Answers2

2

This is currently not possible without modifications to the client. If you want to, you can use Spoutcraft, but this requires users of the plugin to have the Spoutcraft launcher for the textures to show correctly.

There's no way to do this with the vanilla client, however, short of buying a bunch of Minecraft accounts and assigning them appropriate skins.

kabb
  • 2,474
  • 2
  • 17
  • 24
  • xD Buying all the accounts did cross my mind.. however I have over 40 bots.. and that would really add up. What about with a client mod? Know by any chance where I get started into making a client side mod? (If it would work that is) – Tony Mar 29 '14 at 22:40
  • 2
    @TonyBilby Well, you can check out the spoutcraft site, they should have tutorials scattered about the site. You can also try out forge at http://www.minecraftforge.net/, which can work on servers where everyone has forge installed as a mod. – kabb Mar 30 '14 at 00:08
  • 1
    As an added note, forge is generally considered as more versatile, but spoutcraft will work for players without the spoutcraft mod, while forge won't work with players without forge. Players without spoutcraft just won't see the special textures. – kabb Mar 30 '14 at 00:09
  • Actually, there is a way to do this, take a look at the `Citizens` plugin on bukkit: http://dev.bukkit.org/bukkit-plugins/citizens/ – Jojodmo Mar 30 '14 at 00:51
  • @jojodmo To have custom skins with Citizens, you still need Spout: http://wiki.citizensnpcs.co/SpoutPlugin – kabb Mar 30 '14 at 01:18
  • @jojodmo as kabb said they certainly make it clear it's impossibity server side here http://wiki.citizensnpcs.co/Skins and here http://wiki.citizensnpcs.co/Frequently_Asked_Questions :( So i'm going to make a forgeloader plugin! :) – Tony Mar 30 '14 at 01:30
  • I'm pretty sure there's a way to do this with packets... There's a way to change a user's name tag, so technically you could get the skin from a player, then change that entities nametag to something else. – Jojodmo Mar 30 '14 at 01:31
  • @jojodmo There is ABSOLUTELY no way to do this. It has been gone over many times in the bukkit forums, and it can't be done. Even with NMS code and packets, both of which I've used extensively, you can't do it. – kabb Mar 30 '14 at 01:33
  • @jojodmo It says right in the description that "The name over your head affects your skin. This is a minecraft client issue." – kabb Mar 30 '14 at 01:44
  • @kabb must have read that wrong... I still assume it would be possible, just REALLY hard to do. And not worth it at all, but here's my idea - You can create *"holograms"* with `EntityHorses` and `WitherSkeletonSkulls`, you could find a way to change the user's name so it isn't has visible, like make it black. Then, animate the *"holograms"* above the player on `PlayerMoveEvent`... It would work just it really wouldn't be worth it in my opinion – Jojodmo Mar 30 '14 at 02:22
  • @TonyBilby Okay, you may want to look into my idea for holograms if you really want to do this... I think it would be better than making your users get a mod, just my opinion though. About a third, or even more than that of the people won't know how to install mods... Even if there's a tutorial... If you're going for a server that you want a lot of people on, I recommend not using mods... Again, just my view though. – Jojodmo Mar 30 '14 at 02:56
  • @jojodmo I'm not exactly sure we're on the same page here o.O Holograms? I have NPCs created with RemoteEntities and the names of the bots are specific, Example: "alberta (bot)" I want to change the skin of the "bot" to look a certain way (blonde hair, red shirt let's say). and then another bot "ronn (bot)" i want him with a blue shirt.. This is what i want to accomplish. however doing research i don't think spout will work since it's kinda a old/dead project. and Forge is confusing the crap out of me :/ I'm having a difficult time figuring this out. – Tony Mar 30 '14 at 03:03
  • @TonyBilby If you could find a user with the skin you want, the holograms idea would work... Let's say **ROB** has the skin you want, yet, you want his name to be **TOMMY** You could make the `RemoteEntity`, the same way you always do, using **ROB** as the player, then, you could change rob's nametag to be some color that you don't see, like black, Then comes the hard part. Whenever **ROB** moves, you could create a *Hologram* above him using `WitherSkeletonSkulls` and `EntityHorses`. You could put in the hologram the text **TOMMY**, and move it to be over the `RemoteEntity` when it moves – Jojodmo Mar 30 '14 at 03:08
  • @TonyBilby There's a nice "tutorial", I guess you could call it, on holograms here: https://forums.bukkit.org/threads/238097/ – Jojodmo Mar 30 '14 at 03:09
  • @jojodmo but i don't want them to move o.o they're "bartenders" and such and RemoteEntities already allows the ability to move them. I just want to be able to control what they're outfit/skins are without having to purchase every bot name i want to skin and i have an idea on how exactly i want them to look, no other user will have the skin i'm looking for and I also don't want to worry about them changing it in the future and breaking my poor bot. – Tony Mar 30 '14 at 03:12
  • @TonyBilby If you don't want to move them that would actually probably make it easier... you could just create the hologram in your `onEnable()` above the bar tender... Except that is a problem that no user would have the skins you want... If that really is the case then you have no choice but to make a client-side mod. – Jojodmo Mar 30 '14 at 03:34
  • @jojodmo Sadly this is probably going to be the case :( So.. this is my new question http://stackoverflow.com/q/22739920/3200040 lol – Tony Mar 30 '14 at 03:35
  • @TonyBilby I still really think that you shouldn't use a client mod unless its completely necessary, but, if you really think it's going to add enough to your server that it's worth it, go for it. I wish you the best of luck! – Jojodmo Mar 30 '14 at 03:43
  • @jojodmo I think it will :) I've been avoiding it like crazy with so many other things I've wanted to add but kinda did way with ugly loopholes, adding a mod will be very beneficial because I can take a huge load of other things I've tried to make server side with duct tape and glue and would take a lot off the server resources. thanks for your help! – Tony Mar 30 '14 at 03:46
  • @TonyBilby I would absolutely go for SpoutCraft instead of Forge. It is way more easy to install for your players. – jobukkit May 19 '14 at 21:21
1

You should try out the DisguiseCraft plugin for a quick fix. DisguiseCraft is currently available on the Bukkit website. Do keep in mind that it also requires ProtocolLib to function properly, and you will need to have both installed on your server. You may find a link for ProtocolLib through the DisguiseCraft page. I currently use the two on my server and have had no issues with functionality.

If you would prefer a more direct approach however, since you are coding your own plugin, consider looking over the Lib's Disguises Developer API. Like DisguiseCraft, it too requires ProtocolLib, but the source for Lib's is publicly available and is intended to target developers. Just like DisguiseCraft, you may find a link for ProtocolLib through the Lib's page.