Create a full survival game with health, hunger, inventory, crafting, mobs, and day/night cycle.
All voxel world options plus survival-specific settings (health, dayLength)
Game object with sub-APIs: mobs, inventory, recipes, tools, world, player, etc.
const game = await sg.survival.createSurvivalGame({ seed: 42, health: 20, dayLength: 180, spawn: [128, 70, 128],});game.mobs.register('zombie', { health: 20, hostile: true });sg.run({ update() { console.log(game.player.getHealth()); } }); Copy
const game = await sg.survival.createSurvivalGame({ seed: 42, health: 20, dayLength: 180, spawn: [128, 70, 128],});game.mobs.register('zombie', { health: 20, hostile: true });sg.run({ update() { console.log(game.player.getHealth()); } });
Create a full survival game with health, hunger, inventory, crafting, mobs, and day/night cycle.