Skip to content

ResourcePackLoaded ​

com.jsmacrosce.jsmacros.client.api.event.impl.EventResourcePackLoaded

Since1.5.1Not cancellable

Fires when a resource reload completes and the loading overlay begins fading out. The overlay is still visible when the event fires. isGameStart reflects whether that overlay was configured without a fade-in.

js
JsMacros.on("ResourcePackLoaded", JavaWrapper.methodToJava(function (event) {
  const packs = event.loadedPacks;  
  if (event.isGameStart) {
    Chat.log(`startup, with ${packs.size()} packs selected`);  
    return;  
  }
  Chat.log(`reloaded, now on ${packs.size()} packs`);  
}))

Constructors ​

new EventResourcePackLoaded ​

new EventResourcePackLoaded(boolean isGameStart)#
Stores the supplied overlay configuration flag and copies the repository's selected pack identifiers at construction; it does not reload resources or dispatch the event.

Parameters:

  • isGameStart: whether the reload overlay was configured without a fade-in

Fields ​

isGameStart ​

isGameStart: booleanread-only#
Whether the loading overlay for this reload was configured without a fade-in.

loadedPacks ​

loadedPacks: List<String>read-only#
The selected resource-pack identifiers copied when this event is constructed. Later changes to the selection do not update this list.

Methods ​

toString ​

toString(): String#
Returns a diagnostic string containing the event name, stored overlay configuration flag, and current string representation of loadedPacks; this is not serialized JSON.
Returns: the form eventName:{"isGameStart": boolean, "loadedPacks": listString}