I know how to send a specific ResourcePack to a player on my server. I work with multiple small minigames servers and one of the minigames needs a ResourcePack so I send the ResourcePack with this function:
p.setResourcePack("URL");
But now if the player was sent back to the lobby-server, the ResourcePack will not be removed automatically. I'd really like to remove the ResourcePack because if the player plays another game he might be confused by all the special textures. I already tryed to send a "null" ResourcePack
p.setResourcePack(null);
but this throws an Exception.
http://hastebin.com/gojuqesafa.profile
So does anyone know another solution then sending him a default-ResourcePack?
I think the best way would probably be to set the players resource pack to default, do that like this:
First of all, create a new folder called default (or whatever).
Then go into your .minecraft/versions open the folder for the version of minecraft your plugin supports, open the jar file with a program like winrar, and copy the assets folder into the default texture pack folder you just created. Then create a file called pack.mcmeta with these contents:
{
"pack": {
"pack_format": 1,
"description": "Default texture pack"
}
}
afterwards, create a new image (size should be preferrably 64x64 or 128x128) and just make it black, as it doesn't really matter, then upload it to mediafire or another site and get the file link (for mediafire, go to the link they provide you with, right click the green button and press copy link location).
Once that is done, in your code do:
p.setResourcePack("URL TO DEFAULT TEXTURE PACK");
This will not set the players texture pack to what they had before, but it will set it back to the default minecraft texture pack