Gamesetting Module
Provide function to parse Minecraft game settings
Usage
Parse GameSetting (options.txt)
Serialize/Deserialize the minecraft game setting string.
import { GameSetting } from '@xmcl/gamesetting'
const settingString;
const setting: GameSetting = GameSetting.parse(settingString);
const string: string = GameSetting.stringify(setting);
🏳️ Enums
🏭 Functions
getDefaultFrame
getDefaultFrame(): FullFrame
Get the default values in options.txt.
Return Type
FullFrame
Defined in: packages/gamesetting/index.ts:278
parse
parse(str: string, strict: boolean): GameSetting | Frame
Parse raw game setting options.txt content
Parameters
- str:
string
the options.txt content - strict:
boolean
strictly follow the current version of options format (outdate version might cause problem. If your options.txt is new one with new fields, don't turn on this)
Return Type
GameSetting | Frame
Defined in: packages/gamesetting/index.ts:346
stringify
stringify(setting: any, original: string, eol: string= '\n'): string
Generate text format game setting for options.txt file.
Parameters
setting:
any
The game setting objectoriginal:
string
eol:
string
The end of line character, default is\n
Return Type
string
Defined in: packages/gamesetting/index.ts:410
🏷️ Variables
Graphics
Graphics: Readonly<Object> = ...
Defined in: packages/gamesetting/index.ts:30
RenderClouds
RenderClouds: Readonly<Object> = ...
Defined in: packages/gamesetting/index.ts:32
RenderDistances
RenderDistances: Readonly<Object> = ...
Defined in: packages/gamesetting/index.ts:29
⏩ Type Aliases
Frame
Frame: Partial<FullFrame>
Defined in: packages/gamesetting/index.ts:273
FullFrame
FullFrame: typeof DEFAULT_FRAME
Defined in: packages/gamesetting/index.ts:272
GameSetting
GameSetting: ReturnType<typeof getDefaultFrame>
Defined in: packages/gamesetting/index.ts:429
Graphic
Graphic: boolean
Defined in: packages/gamesetting/index.ts:31
HotKeys
HotKeys: "attack" | "use" | "forward" | "left" | "back" | "right" | "jump" | "sneak" | "sprint" | "drop" | "inventory" | "chat" | "playerlist" | "pickItem" | "command" | "screenshot" | "togglePerspective" | "smoothCamera" | "fullscreen" | "spectatorOutlines" | "swapHands" | "saveToolbarActivator" | "loadToolbarActivator" | "advancements" | "hotbar.1" | "hotbar.2" | "hotbar.3" | "hotbar.4" | "hotbar.5" | "hotbar.6" | "hotbar.7" | "hotbar.8" | "hotbar.9"
Defined in: packages/gamesetting/index.ts:306
MipmapLevel
MipmapLevel: 0 | 1 | 2 | 3 | 4
Defined in: packages/gamesetting/index.ts:27
ModelPart
ModelPart: "cape" | "jacket" | "left_sleeve" | "right_sleeve" | "left_pants_leg" | "right_pants_leg" | "hat"
Defined in: packages/gamesetting/index.ts:285
RenderCloud
RenderCloud: boolean | "fast"
Defined in: packages/gamesetting/index.ts:33
RenderDistance
RenderDistance: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32
Defined in: packages/gamesetting/index.ts:28
SoundCategories
SoundCategories: "master" | "music" | "record" | "weather" | "block" | "hostile" | "neutral" | "player" | "ambient" | "voice"
Defined in: packages/gamesetting/index.ts:294