Represents the game rules for a world experience.

import { world } from "@minecraft/server";

world.gameRules.doDayLightCycle = false;
world.gameRules.doEntityDrops = false;
world.gameRules.doFireTick = false;
world.gameRules.doWeatherCycle = false;
world.gameRules.doMobSpawning = false;
world.gameRules.showCoordinates = true;
world.gameRules.showDaysPlayed = true;
world.gameRules.keepInventory = true;
import { world } from "@minecraft/server";

world.gameRules.drowningDamage = false;
world.gameRules.fallDamage = false;
world.gameRules.fireDamage = false;
world.gameRules.freezeDamage = false;
world.gameRules.pvp = false;

Properties

commandBlockOutput: boolean

This property can't be edited in read-only mode.

commandBlocksEnabled: boolean

This property can't be edited in read-only mode.

doDayLightCycle: boolean

This property can't be edited in read-only mode.

doEntityDrops: boolean

This property can't be edited in read-only mode.

doFireTick: boolean

This property can't be edited in read-only mode.

doImmediateRespawn: boolean

This property can't be edited in read-only mode.

doInsomnia: boolean

This property can't be edited in read-only mode.

doLimitedCrafting: boolean

This property can't be edited in read-only mode.

doMobLoot: boolean

This property can't be edited in read-only mode.

doMobSpawning: boolean

This property can't be edited in read-only mode.

doTileDrops: boolean

This property can't be edited in read-only mode.

doWeatherCycle: boolean

This property can't be edited in read-only mode.

drowningDamage: boolean

This property can't be edited in read-only mode.

fallDamage: boolean

This property can't be edited in read-only mode.

fireDamage: boolean

This property can't be edited in read-only mode.

freezeDamage: boolean

This property can't be edited in read-only mode.

functionCommandLimit: number

This property can't be edited in read-only mode.

keepInventory: boolean

This property can't be edited in read-only mode.

maxCommandChainLength: number

This property can't be edited in read-only mode.

mobGriefing: boolean

This property can't be edited in read-only mode.

naturalRegeneration: boolean

This property can't be edited in read-only mode.

playersSleepingPercentage: number

This property can't be edited in read-only mode.

projectilesCanBreakBlocks: boolean

This property can't be edited in read-only mode.

pvp: boolean

This property can't be edited in read-only mode.

randomTickSpeed: number

This property can't be edited in read-only mode.

recipesUnlock: boolean

This property can't be edited in read-only mode.

respawnBlocksExplode: boolean

This property can't be edited in read-only mode.

sendCommandFeedback: boolean

This property can't be edited in read-only mode.

showBorderEffect: boolean

This property can't be edited in read-only mode.

showCoordinates: boolean

This property can't be edited in read-only mode.

showDeathMessages: boolean

This property can't be edited in read-only mode.

showRecipeMessages: boolean

This property can't be edited in read-only mode.

showTags: boolean

This property can't be edited in read-only mode.

spawnRadius: number

This property can't be edited in read-only mode.

tntExplodes: boolean

This property can't be edited in read-only mode.

tntExplosionDropDecay: boolean

This property can't be edited in read-only mode.