Skip to content

ProfileLoad ​

com.jsmacrosce.jsmacros.core.event.impl.EventProfileLoad

Since1.2.7Not cancellable

Fires after a profile's script triggers have been registered, including at startup and on profile switches. Script event listeners remain registered when triggers are replaced, so listeners can observe subsequent loads. No event is fired when the profile has no trigger list; a missing profile is created with an empty list and does fire this event.

js
// The default profile's index.js can register a listener for later profile switches.  
JsMacros.on("ProfileLoad", JavaWrapper.methodToJava(function (event) {
  Chat.log(`"${event.profileName}" is ready, setting the rest of the profile up`);  
}));

Constructors ​

new EventProfileLoad ​

new EventProfileLoad(BaseProfile profile, String profileName)#
Initializes this event with the source profile's runner and stores the supplied profile name.

Parameters:

  • profile: source of the event core
  • profileName: name stored in the event payload

Fields ​

profileName ​

profileName: Stringread-only#
The name of the profile that was loaded.

Methods ​

toString ​

toString(): String#
Returns diagnostic text naming this event and its profile, formatted as eventName:{"profileName": profileName}. This is not a JSON serialization contract.
Returns: diagnostic text naming the event and profile