ResourcePack not sending to player


I am trying to make the user download a resource pack with the player.sendResourcePack method but it is not sending at all at the moment.

My Code:

public void onGamePreInitialization(GamePreInitializationEvent event) {                
	kickMessage = Text.of(confNode.getNode("Kick-Message").getString());
	//try to get resource pack zip file from packrequirements folder
	try {
		packURI = new URI(folder.toURI().toString() + confNode.getNode("Resource-Pack").getString());
	} catch (URISyntaxException e) {
	//setting the ResourcePack to the config specified pack
    try {
		sendPack = ResourcePacks.fromUri(packURI);"Loaded Resource pack from " + packURI);
	} catch (FileNotFoundException e) {

public void onPlayerJoin(ClientConnectionEvent.Join event, @Root Player player) {
	//send pack to the player;

This will load up and the final logger from onPlayerJoin method prints out

[20:57:38] [Server thread/INFO] [packrequirements]: SpongeURIResourcePack{id=e0622ad8-7eda-4e43-8e36-49599c9632f2, uri=file:/C:/Users/21cra/OneDrive/Documents/Servers/TestServer/./config/packrequirements/Madoku+Craft+(Version+26.0).zip}

the modpack listed is what is specified in the config on loadConfig() and that pack name is in the config folder at /config/packrequirements.

Any help is appreciated


A pack URI cannot be a file URI like that. The pack must be downloadable over HTTP.


Doesn’t this create problems when the pack does not download in time?


I have no idea what you mean by ‘not download in time’. The pack just gets downloaded.


Yeahhh just now noticing that. I thought the way the method worked was to download it locally then send it to the player instead of sending it directly from the URI to the player


No. The URI is sent to the player and the player downloads it themselves.


Yup now realizing after testing. Thanks