@jsprismarine/minecraft
Version:
Minecraft: Bedrock Edition data and related utilities
46 lines • 1.28 kB
TypeScript
/**
* Gametype.
* @remarks Also known as `Gamemode`.
* @group Gametype
*/
export declare enum Gametype {
UNDEFINED = -1,
SURVIVAL = 0,
CREATIVE = 1,
ADVENTURE = 2,
DEFAULT = 0,
SPECTATOR = 3,
WORLD_DEFAULT = 0
}
/**
* Gametype name.
* @group Gametype
*/
export type GametypeName = 'Survival' | 'Creative' | 'Adventure' | 'Spectator';
/**
* Get Gametype name.
* @param {Gametype} mode - The Gametype to get the name of.
* @returns {GametypeName} The Gametype name.
* @throws {GametypeInvalidError} Thrown if the Gametype is invalid.
* @group Gametype
* @example
* ```typescript
* const gametype = getGametypeName(Gametype.SURVIVAL);
* console.log(gametype); // 'Survival'
* ```
*/
export declare function getGametypeName(mode: Gametype): GametypeName;
/**
* Get Gametype from name.
* @param {GametypeName | string | number} mode - The Gametype to get the ID of.
* @returns {Gametype} The Gametype ID.
* @throws {GametypeInvalidError} Thrown if the Gametype is invalid.
* @group Gametype
* @example
* ```typescript
* const gametype = getGametypeId('survival');
* console.log(gametype); // 0
* ```
*/
export declare function getGametypeId(mode: GametypeName | string | number): Gametype;
//# sourceMappingURL=Gametype.d.ts.map