Represents a home for the home system.

Constructors

  • Creates an instance of the Home class.

    Parameters

    • home: {
          format_version?: string;
          home_format_version?: string;
          location: DimensionLocation;
          name: string;
          owner?: Player;
          ownerId?: string;
          ownerName?: string;
          saveId: string;
      }

      The home to create.

      • Optionalformat_version?: string

        The version of the add-on that this home was saved with.

      • Optionalhome_format_version?: string

        The format version the home system was on when this home was saved.

      • location: DimensionLocation

        The location and dimension of the home.

      • name: string

        The name of the home.

      • Optionalowner?: Player

        The owner of the home.

      • OptionalownerId?: string

        The ID of the owner of the home.

      • OptionalownerName?: string

        The name of the owner of the home.

      • saveId: string

        The save ID of the home.

    Returns Globals.modules.cmds.Home

    The created home.

Properties

format_version?: string

The version of the add-on that this home was saved with.

home_format_version?: string

The format version the home system was on when this home was saved.

The location and dimension of the home.

name: string

The name of the home.

ownerId: string

The ID of the owner of the home.

ownerName?: string

The name of the owner of the home.

saveId: string

The save ID of the home.

Accessors

  • get isOwnerOnline(): boolean

    Checks if the owner of the home is online.

    Returns boolean

    True if the owner of the home is online, false otherwise.

  • get isSaved(): boolean

    Checks if the home is saved.

    Returns boolean

    True if the home is saved, false otherwise.

  • get owner(): Player

    Returns the owner of the home if they are online, otherwise returns undefined.

    Returns Player

    The owner of the home if they are online, otherwise returns undefined.

Methods

  • Removes the home.

    Returns void

  • Saves the home.

    Parameters

    • OptionalotherDataToChange: Partial<
          {
              format_version: string;
              home_format_version: string;
              location: Vector3 & { dimension: string };
              name: string;
              ownerId: string;
              ownerName: string;
          },
      > = {}

      Additional data to add to the home.

    • OptionalkeepOldFormatVersion: boolean = false

      If set to true, the format version won't be set to the current version.

    Returns void

  • Converts the home to a JSON object.

    Returns {
        format_version: string;
        home_format_version: string;
        location: Vector3 & { dimension: string };
        name: string;
        ownerId: string;
        ownerName: string;
    }

    The JSON object representing this home.

  • Deletes the home with the given save ID.

    This function just deletes the world dynamic property with the given ID.

    Parameters

    • homeId: string

      The save ID of the home to delete.

    Returns void

  • Gets the home with the given save ID.

    Parameters

    • homeId: string

      The save ID of the home.

    Returns Globals.modules.cmds.Home

    The home with the given save ID.