[EPIC] Runtime Texture Pack Change

Discussion in 'Plugin Development' started by Icyene, Aug 22, 2012.

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


    That is what PluginChannels are for, they are to support a link between a client mod and a server plugin. But the Texture Pack changing that Icyene was doing is done without client mod.
  2. Offline


    Actually you can change player's nametags without affecting their skins now:
  3. Offline


    Read the post:
  4. whitehooder Since v1.3 the skin doesn't get changed if you just change the color.
  5. Offline


    Doesn't? Thats some real good news you've got there :D
  6. Offline


    how exact does this work? can you also force a texture pack without mods installed?

    if yes, could someone give me the steps how to do it?

    p.s. if you have no client mod, will your client crash?
  7. Offline


    This. Entire. Post. Is. About. That. YES, YOU CAN.

    MC 1.3.x can make servers impose texture packs. There are 3 ways of doing this. The easiest:

     public void setTexture(Player toSetOn, String pathToTexture) {
        ((CraftPlayer) toSetOn).getHandle().netServerHandler
            .sendPacket(new Packet250CustomPayload("MC|TPack",
                (pathToTexture + "\0" + 16).getBytes()));

    public void setTexture(Player toSetOn, String pathToTexture) {
        ((CraftPlayer) toSetOn).getHandle().a(pathToTexture, 16);
    I think they are pretty obvious as to what they do. Have fun.
  8. Offline


    No, it's just possible to suggest the user to use a specific texture pack, he may deny the request and he'll never see it again.
  9. Offline


    Or he can accept it and he will never see it again.
    Icyene likes this.
  10. Offline


    But you can't force a texture pack to a player, like Icyene said.
  11. Offline


    But its still pretty darn close...
  12. Offline


    This is SO awesome!
  13. Offline


    eclipse gives a red line under: ((CraftPlayer) toSetOn) and Packet250CustomPayload
    is this normal?
  14. Offline


    you need to use the craftbukkit jar i think
    Icyene likes this.
  15. Offline


    CorrieKay is the craftbukkit jar the same as the bukkit 1.3.1 jar (The jar needed for coding any plugin)?
  16. Offline


    SmokyMiner No. craftbukkit is the jar you use to run a server.
  17. Offline


    I just added the craftbukkit.jar but eclipse is still giving me the error.
    same spots, it say "CraftPlayer cannot be resolved to type." and "Packet250CustomPayload cannont be resolved to type."

    Edit: I move the code to the Listener class instead of my main class, it then let me import Packet250CustomPayload, but Im still getting the error for CraftPlayer

    Edit2: I put import org.bukkit.craftbukkit.entity.CraftPlayer; at the top and the error went away. Normally eclipse tells me to import something if necessary so i didn't think that was the problem.

    So I got it working, but when testing with multiple people the yes/no menu only pops up for me

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 28, 2016
  18. SmokyMiner The menu pops up for the player you specified. The whole purpose is to set the texture >for one player only<. Also the menu pops up only one time and then never again, no matter how often you use this method to change the texture. Even after a client restart it won't pop up again.
  19. Offline



    I set it up for OnPlayerJoin then it gets the player that joined and sends the packet to that player, but itll only send it to me. It wont send it to my friends when they join

    I tried it with a cracked account my reg account and 2 other ppl connected to the server, only the cracked and my account got the message, and there were both connect with localhost, but it doesnt seem to send anything to the
  20. SmokyMiner Maybe cause of network lag the packet comes to the client before he's able to handle it. Try to use the scheduler to delay it.
  21. Offline


    It waits like 3:00 before sending the packets and it still only works for localhost connected player.
  22. Offline


    This is the day in age when plugin developers think outside the bukkit.
    iKeirNez, kroltan and blackwolf12333 like this.
  23. Offline


    But Bukkit can hold anything....
    iKeirNez and kroltan like this.
  24. Offline


    Just out of curiosity, anyone else experiencing the same problem I have?
  25. Offline


    Popping in here since my last post - so it's not possible?
  26. Offline


    chaseoes It is possible... See my plugin, Storm. Specifically, this image. Its working perfectly for me, and has been since I wrote this post. No latency issues, either.
    hawkfalcon likes this.
  27. Offline


    This looks so awesome.
  28. Offline


    You should write something about how you did this so other people can use this
    But that just looks awesome!
    hawkfalcon and SmokyMiner like this.
  29. Offline


    Just to clarify, did the text on screen work, or do you need a mod for that?
  30. Offline


    You need a mod for the screen text. For the TPack change you do not.
Thread Status:
Not open for further replies.

Share This Page