Class BaseModAbstract

Hierarchy

Constructors

Properties

event: IEventEmitter<BaseMod, 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>

  • 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