Skip to content

helix / Gamemode

Variable: Gamemode

const Gamemode: object

Defined in: core/values/enums.ts:14

gamemode - the four vanilla game modes. A named-constant namespace and the string-union type of the same name (TS declaration merging): author Gamemode.SURVIVAL instead of the bare, typo-prone "survival", while Gamemode still types every gamemode: Gamemode parameter (commands and Selector.gamemode) as the union of the four ids. Each member is the vanilla id the command/selector renders - same "typed concepts, not strings" stance as Slot, Item.DIAMOND, Block.STONE.

Type Declaration

ADVENTURE

readonly ADVENTURE: "adventure" = "adventure"

CREATIVE

readonly CREATIVE: "creative" = "creative"

SPECTATOR

readonly SPECTATOR: "spectator" = "spectator"

SURVIVAL

readonly SURVIVAL: "survival" = "survival"

Released under the MIT License · Credits