Class BaseModAbstract

Hierarchy

Constructors

Properties

index: number
registerEventHandlersOnPreLoad: boolean = true

Accessors

  • get log(): default
  • Returns default

  • 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

  • Deprecated

    Use the index property

    Returns number

  • Deprecated

    Use the log property

    Returns default

  • Returns the name of this mod.

    Deprecated

    Use the name property

    Returns string

  • Deprecated

    Use the path property

    Returns string

  • Returns the prefix for this mod used in registrations. Example: A mod named Debug Tools would be ModDebugTools

    Deprecated

    Use the prefix property

    Returns string

  • 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

  • Deprecated

    Use the version property

    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: any

      Any existing data, or undefined

    Returns any

  • 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: any

      Any existing data, or undefined

    Returns any

  • 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