Class defaultAbstract

Hierarchy

Constructors

Properties

event: IEventEmitter<default, IModEvents>
registerEventHandlersOnPreLoad: boolean = true

Accessors

  • get log(): Log
  • Returns Log

  • get name(): string
  • Returns string

  • get path(): string
  • Returns string

  • get prefix(): string
  • The prefix for this mod used in registrations. Example: A mod named Debug Tools would be ModDebugTools

    Returns string

  • get version(): string
  • Returns string

Methods

  • Returns the full registry name for the given registration name, concatenating the mod registration prefix. Example: A mod named Debug Tools registering Cool Thingy would be ModDebugToolsCoolThingy

    Parameters

    • name: string

    Returns string

  • Called when the global data for this mod is retrieved from a field decorated with @Mod.globalData.

    Returns

    The data that should be returned. Conventionally, this is an object of some kind. It must be JSON serializable.

    This method is meant to be overridden. It is called internally.

    Parameters

    • data: unknown

      Any existing data, or undefined

    Returns unknown

  • Called when the save data for this mod is retrieved from a field decorated with @Mod.saveData.

    Returns

    The data that should be returned. Conventionally, this is an object of some kind. It must be JSON serializable.

    This method is meant to be overridden. It is called internally.

    Parameters

    • data: unknown

      Any existing data, or undefined

    Returns unknown

  • Parameters

    • file: string

    Returns Promise<undefined | string>

  • Called when the mod is initialized (when it's enabled via the Mod Manager)

    Returns void

  • Called when the mod is loaded. This will be called after a player starts a game (ran before resources & the world are setup)

    Returns void

  • Called before the mod is uninitialized (when it's disabled via the Mod Manager)

    Returns void

  • Called after the mod is uninitialized

    Returns void

  • Called when the mod is unloaded

    Returns void

  • Registers event handlers, injections, and bind handlers. This is called on the preLoad event by default, and the handlers are deregistered on the unload event.

    If you call this manually before preLoad, it won't be called on preLoad and it won't deregister on unload.

    Please note that registering handlers when the mod is initialized means that the handlers will remain registered even when the user is playing on a server that doesn't support the mod.

    Parameters

    Returns void

Generated using TypeDoc