Skip to content

issue with setResourcePack for the second time. #408

@miladm78

Description

@miladm78

Expected behavior

When I try to do setResourcePack a second time it works successfully

Observed/Actual behavior

When I set the resource pack for a player for the first time, everything works correctly. However, when I try to apply the another resource pack for the player a second time, it does not happen, and I do not receive any errors

Steps/models to reproduce

public class ResourcePackManager {

private static final String FIRST_RESOURCE_PACK_URL = "http://test.com/a.zip";
private static final String SECOND_RESOURCE_PACK_URL = "http://test.com/b.zip";
private static final String HASH_KEY = "hash_key"; // Example hash key, replace with actual

// Method to send the resource packs
public static void sendResourcePacks(JavaPlugin plugin, Player player) {
    // Send the first resource pack
    player.setResourcePack(FIRST_RESOURCE_PACK_URL, HASH_KEY);
    
    // Schedule a task to send the second resource pack after 1 minute
    new BukkitRunnable() {
        @Override
        public void run() {
            player.setResourcePack(SECOND_RESOURCE_PACK_URL, HASH_KEY);
        }
    }.runTaskLater(plugin, 20L * 60); // 20 ticks * 60 seconds = 1 minute
}

}

Plugin and Datapack List

my ResourcePackManager

MultiPaper version

on latest version
79b6271

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions