Game Namespace
Game Namespace
Section titled “Game Namespace”The Game namespace is Ceremony’s primary API surface. It organizes server-side scripting capabilities into logical sub-namespaces for particles, sounds, combat, entities, scheduling, HUD management, camera control, regions, display entities, events, and state persistence.
All methods are accessed through Game.<namespace>.<method>().
Game.particles
Section titled “Game.particles”Spawn and shape particle effects in the world. All particle methods accept a level (the server level/world), a particle type (Minecraft particle ID string or a particle type object), a position (Vec3Like), and an optional ParticleOpts object.
ParticleOpts Interface
Section titled “ParticleOpts Interface”| Property | Type | Default | Description |
|---|---|---|---|
count | number | 1 | Number of particles to spawn |
speed | number | 0 | Particle speed/spread multiplier |
dx | number | 0 | X-axis offset/spread |
dy | number | 0 | Y-axis offset/spread |
dz | number | 0 | Z-axis offset/spread |
Methods
Section titled “Methods”spawn(level, type, pos, opts?)
Section titled “spawn(level, type, pos, opts?)”Spawns particles at a position, visible to all nearby players.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level (world) |
type | string | any | Particle type ID or particle object |
pos | Vec3Like | Position { x, y, z } |
opts | ParticleOpts | Optional particle settings |
// Basic particle burstGame.particles.spawn(level, 'flame', { x: 100, y: 65, z: 200 }, { count: 30, speed: 0.1, dx: 0.5, dy: 0.5, dz: 0.5});
// Smoke cloud at an explosion siteGame.particles.spawn(level, 'large_smoke', pos, { count: 50, speed: 0.05, dx: 1.0, dy: 0.5, dz: 1.0});spawnForPlayer(player, type, pos, opts?)
Section titled “spawnForPlayer(player, type, pos, opts?)”Spawns particles visible only to a specific player. Same parameters as spawn, but takes a player instead of level.
| Parameter | Type | Description |
|---|---|---|
player | any | Target ServerPlayer |
type | string | any | Particle type ID |
pos | Vec3Like | Position { x, y, z } |
opts | ParticleOpts | Optional particle settings |
// Show a personal waypoint glow to one playerGame.particles.spawnForPlayer(player, 'end_rod', waypointPos, { count: 10, speed: 0.02, dy: 0.3});circle(level, type, center, radius, count, opts?)
Section titled “circle(level, type, center, radius, count, opts?)”Spawns particles in a horizontal circle.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
type | string | any | Particle type ID |
center | Vec3Like | Center position |
radius | number | Circle radius in blocks |
count | number | Number of particles around the ring |
opts | ParticleOpts | Optional settings |
// Summoning circle effectGame.particles.circle(level, 'enchant', playerPos, 3.0, 40, { speed: 0.02});sphere(level, type, center, radius, count, opts?)
Section titled “sphere(level, type, center, radius, count, opts?)”Spawns particles in a sphere shape.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
type | string | any | Particle type ID |
center | Vec3Like | Center position |
radius | number | Sphere radius |
count | number | Number of particles |
opts | ParticleOpts | Optional settings |
// Protective shield bubbleGame.particles.sphere(level, 'soul_fire_flame', playerPos, 4.0, 80, { speed: 0.01});line(level, type, start, end, count, opts?)
Section titled “line(level, type, start, end, count, opts?)”Spawns particles along a line between two points.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
type | string | any | Particle type ID |
start | Vec3Like | Start position |
end | Vec3Like | End position |
count | number | Number of particles along the line |
opts | ParticleOpts | Optional settings |
// Laser beam between two pointsGame.particles.line(level, 'electric_spark', senderPos, targetPos, 30, { speed: 0.0});spiral(level, type, center, radius, height, count, opts?)
Section titled “spiral(level, type, center, radius, height, count, opts?)”Spawns particles in a vertical spiral/helix.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
type | string | any | Particle type ID |
center | Vec3Like | Base center position |
radius | number | Spiral radius |
height | number | Total spiral height |
count | number | Number of particles |
opts | ParticleOpts | Optional settings |
// Teleportation effectGame.particles.spiral(level, 'portal', playerPos, 1.5, 3.0, 60, { speed: 0.02});beam(level, type, start, end, opts?)
Section titled “beam(level, type, start, end, opts?)”Spawns a dense beam of particles between two points. Similar to line but optimized for thick, visible beams.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
type | string | any | Particle type ID |
start | Vec3Like | Start position |
end | Vec3Like | End position |
opts | ParticleOpts | Optional settings |
// Beacon-style beam shooting upwardconst ground = { x: 100, y: 65, z: 200 };const sky = { x: 100, y: 120, z: 200 };Game.particles.beam(level, 'end_rod', ground, sky, { speed: 0.0});Game.sounds
Section titled “Game.sounds”Play sounds and sound sequences for players.
SoundStep Interface
Section titled “SoundStep Interface”Used by Game.sounds.sequence() to define a timed sequence of sounds.
| Property | Type | Default | Description |
|---|---|---|---|
sound | string | — | Minecraft sound identifier |
delay | number | 0 | Delay in ticks before playing this sound |
volume | number | 1.0 | Volume level |
pitch | number | 1.0 | Pitch multiplier |
Methods
Section titled “Methods”play(player, soundName, volume?, pitch?)
Section titled “play(player, soundName, volume?, pitch?)”Plays a sound at the player’s location.
| Parameter | Type | Default | Description |
|---|---|---|---|
player | any | — | Target player |
soundName | string | — | Minecraft sound identifier |
volume | number | 1.0 | Volume |
pitch | number | 1.0 | Pitch |
Game.sounds.play(player, 'entity.player.levelup', 0.8, 1.2);playAt(level, soundName, pos, volume?, pitch?)
Section titled “playAt(level, soundName, pos, volume?, pitch?)”Plays a sound at a specific world position, audible to all nearby players.
| Parameter | Type | Default | Description |
|---|---|---|---|
level | any | — | Server level |
soundName | string | — | Minecraft sound identifier |
pos | Vec3Like | — | World position |
volume | number | 1.0 | Volume |
pitch | number | 1.0 | Pitch |
// Explosion sound at a locationGame.sounds.playAt(level, 'entity.generic.explode', { x: 100, y: 65, z: 200 }, 1.0, 0.8);sequence(player, steps)
Section titled “sequence(player, steps)”Plays a timed sequence of sounds for a player. Useful for jingles, fanfares, and musical effects.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
steps | SoundStep[] | Array of sound steps with timing |
// Victory jingleGame.sounds.sequence(player, [ { sound: 'block.note_block.chime', delay: 0, volume: 0.8, pitch: 1.0 }, { sound: 'block.note_block.chime', delay: 5, volume: 0.8, pitch: 1.2 }, { sound: 'block.note_block.chime', delay: 5, volume: 0.8, pitch: 1.5 }, { sound: 'entity.player.levelup', delay: 10, volume: 1.0, pitch: 1.0 }]);stop(player, soundName)
Section titled “stop(player, soundName)”Stops a currently playing sound for a player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
soundName | string | Sound identifier to stop |
Game.sounds.stop(player, 'music.creative');Game.combat
Section titled “Game.combat”Damage, heal, knockback, and apply effects to entities.
EffectOpts Interface
Section titled “EffectOpts Interface”| Property | Type | Default | Description |
|---|---|---|---|
duration | number | 200 | Effect duration in ticks |
amplifier | number | 0 | Effect level (0 = level I, 1 = level II, etc.) |
ambient | boolean | false | Whether the effect is ambient (translucent particles) |
visible | boolean | true | Whether particles are visible |
showIcon | boolean | true | Whether the effect icon appears in the HUD |
Methods
Section titled “Methods”damage(entity, amount, source?)
Section titled “damage(entity, amount, source?)”Deals damage to an entity.
| Parameter | Type | Description |
|---|---|---|
entity | any | Target entity |
amount | number | Damage amount (in half hearts) |
source | any | Optional damage source |
// Deal 4 hearts of damageGame.combat.damage(targetEntity, 8.0);knockback(entity, strength, dirX, dirZ)
Section titled “knockback(entity, strength, dirX, dirZ)”Applies knockback to an entity in a direction.
| Parameter | Type | Description |
|---|---|---|
entity | any | Target entity |
strength | number | Knockback strength |
dirX | number | X direction component |
dirZ | number | Z direction component |
// Knock the entity backward (away from the attacker)Game.combat.knockback(target, 1.5, directionX, directionZ);knockbackFrom(entity, strength, source)
Section titled “knockbackFrom(entity, strength, source)”Applies knockback away from a source entity.
| Parameter | Type | Description |
|---|---|---|
entity | any | Target entity to knock back |
strength | number | Knockback strength |
source | any | Entity to knock back away from |
// Explosive pushback from a bossGame.combat.knockbackFrom(player, 2.0, bossEntity);addEffect(entity, effectId, opts?)
Section titled “addEffect(entity, effectId, opts?)”Applies a potion effect to an entity.
| Parameter | Type | Description |
|---|---|---|
entity | any | Target entity |
effectId | string | Effect ID (e.g., 'speed', 'strength', 'regeneration') |
opts | EffectOpts | Optional effect settings |
// Speed boost for 30 seconds (600 ticks), level IIGame.combat.addEffect(player, 'speed', { duration: 600, amplifier: 1, visible: true, showIcon: true});
// Invisible glowing effect for taggingGame.combat.addEffect(target, 'glowing', { duration: 200, amplifier: 0, ambient: true, visible: false, showIcon: false});
// Regeneration for healing over timeGame.combat.addEffect(player, 'regeneration', { duration: 100, amplifier: 2, visible: true});removeEffect(entity, effectId)
Section titled “removeEffect(entity, effectId)”Removes a potion effect from an entity.
| Parameter | Type | Description |
|---|---|---|
entity | any | Target entity |
effectId | string | Effect ID to remove |
Game.combat.removeEffect(player, 'poison');hasEffect(entity, effectId)
Section titled “hasEffect(entity, effectId)”Checks whether an entity has a specific potion effect.
| Parameter | Type | Description |
|---|---|---|
entity | any | Target entity |
effectId | string | Effect ID to check |
Returns: boolean
if (Game.combat.hasEffect(player, 'fire_resistance')) { msg(player, '<gold>You are immune to fire!');}heal(entity, amount)
Section titled “heal(entity, amount)”Heals an entity by a specified amount.
| Parameter | Type | Description |
|---|---|---|
entity | any | Target entity |
amount | number | Heal amount (in half hearts) |
// Heal 5 heartsGame.combat.heal(player, 10.0);entitiesInRadius(level, pos, radius)
Section titled “entitiesInRadius(level, pos, radius)”Finds all entities within a spherical radius of a position.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
pos | Vec3Like | Center position |
radius | number | Search radius in blocks |
Returns: Entity[]
// Area-of-effect damageconst nearby = Game.combat.entitiesInRadius(level, explosionPos, 10);for (const entity of nearby) { Game.combat.damage(entity, 6.0); Game.combat.knockbackFrom(entity, 1.0, explosionPos);}entitiesInBox(level, min, max)
Section titled “entitiesInBox(level, min, max)”Finds all entities within an axis-aligned bounding box.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
min | Vec3Like | Minimum corner { x, y, z } |
max | Vec3Like | Maximum corner { x, y, z } |
Returns: Entity[]
// Check for entities inside a roomconst inRoom = Game.combat.entitiesInBox(level, { x: 90, y: 60, z: 190 }, { x: 110, y: 70, z: 210 });msg(player, `<gray>Entities in room: <white>${inRoom.length}`);Game.entities
Section titled “Game.entities”Find, spawn, and query entities and players.
Methods
Section titled “Methods”find(level, uuid)
Section titled “find(level, uuid)”Finds an entity by its UUID.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
uuid | string | Entity UUID |
Returns: Entity | null
const npc = Game.entities.find(level, 'bb030064-870d-4513-b49b-bba5c92b19c1');if (npc) { msg(player, '<gray>Found the NPC!');}near(level, pos, radius)
Section titled “near(level, pos, radius)”Finds all entities within a radius of a position.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
pos | Vec3Like | Center position |
radius | number | Search radius |
Returns: Entity[]
const nearby = Game.entities.near(level, playerPos, 20);nearOfType(level, pos, radius, entityType)
Section titled “nearOfType(level, pos, radius, entityType)”Finds entities of a specific type within a radius.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
pos | Vec3Like | Center position |
radius | number | Search radius |
entityType | string | Entity type ID (e.g., 'minecraft:zombie') |
Returns: Entity[]
// Find all nearby zombiesconst zombies = Game.entities.nearOfType(level, playerPos, 30, 'minecraft:zombie');msg(player, `<red>${zombies.length} zombies nearby!`);spawn(level, entityType, pos)
Section titled “spawn(level, entityType, pos)”Spawns a new entity at a position.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
entityType | string | Entity type ID |
pos | Vec3Like | Spawn position |
Returns: Entity
// Spawn a villager NPCconst villager = Game.entities.spawn(level, 'minecraft:villager', { x: 100, y: 65, z: 200});players(level?)
Section titled “players(level?)”Gets all online players, optionally filtered by level/world.
| Parameter | Type | Description |
|---|---|---|
level | any | Optional: filter to a specific level/world |
Returns: ServerPlayer[]
// All online playersconst allPlayers = Game.entities.players();
// Players in a specific worldconst overworldPlayers = Game.entities.players(overworldLevel);playerByName(name)
Section titled “playerByName(name)”Finds an online player by their username.
| Parameter | Type | Description |
|---|---|---|
name | string | Player username (case-insensitive) |
Returns: ServerPlayer | null
const target = Game.entities.playerByName('Notch');if (target) { msg(target, '<gold>You have been summoned!');}playerByUUID(uuid)
Section titled “playerByUUID(uuid)”Finds an online player by their UUID.
| Parameter | Type | Description |
|---|---|---|
uuid | string | Player UUID |
Returns: ServerPlayer | null
const player = Game.entities.playerByUUID('069a79f4-44e9-4726-a5be-fca90e38aaf5');Game.scheduler
Section titled “Game.scheduler”Schedule delayed, repeating, and sequenced tasks on the server tick loop.
SchedulerHandle Interface
Section titled “SchedulerHandle Interface”Returned by every(). Use it to control repeating tasks.
| Method | Returns | Description |
|---|---|---|
cancel() | void | Stops the repeating task |
isRunning() | boolean | Whether the task is still active |
SequenceStep Interface
Section titled “SequenceStep Interface”Used by sequence() to define ordered steps with delays.
| Property | Type | Description |
|---|---|---|
delay | number | Ticks to wait before executing this step |
action | function | The callback to run |
Methods
Section titled “Methods”after(ticks, callback)
Section titled “after(ticks, callback)”Runs a callback once after a delay.
| Parameter | Type | Description |
|---|---|---|
ticks | number | Delay in ticks |
callback | function | Function to execute |
// Despawn entity after 10 secondsGame.scheduler.after(200, () => { entity.discard();});every(ticks, callback)
Section titled “every(ticks, callback)”Runs a callback repeatedly at a fixed interval. Returns a SchedulerHandle to control the task.
| Parameter | Type | Description |
|---|---|---|
ticks | number | Interval in ticks between executions |
callback | function | Function to execute each interval |
Returns: SchedulerHandle
// Regeneration aura: heal nearby players every 3 secondsconst healTask = Game.scheduler.every(60, () => { const nearby = Game.entities.near(level, shrinePos, 10); for (const entity of nearby) { Game.combat.heal(entity, 2.0); Game.particles.spawnForPlayer(entity, 'heart', entity.position(), { count: 3, dy: 0.5 }); }});
// Stop after 2 minutesGame.scheduler.after(2400, () => { healTask.cancel();});
// Check if still runningif (healTask.isRunning()) { msg(player, '<green>Healing aura is active');}sequence(steps)
Section titled “sequence(steps)”Executes a series of steps with individual delays between them.
| Parameter | Type | Description |
|---|---|---|
steps | SequenceStep[] | Array of delay + action pairs |
// Boss spawn sequenceGame.scheduler.sequence([ { delay: 0, action: () => { broadcast('<dark_red>The ground begins to tremble...'); Game.sounds.playAt(level, 'entity.wither.ambient', bossSpawnPos, 1.0, 0.5); } }, { delay: 60, action: () => { broadcast('<dark_red>A dark presence emerges!'); Game.particles.sphere(level, 'smoke', bossSpawnPos, 5.0, 100); } }, { delay: 40, action: () => { const boss = Game.entities.spawn(level, 'minecraft:wither', bossSpawnPos); broadcast('<dark_red><bold>THE WITHER HAS ARRIVED!'); Game.particles.sphere(level, 'explosion', bossSpawnPos, 3.0, 50); } }]);afterAsync(ticks)
Section titled “afterAsync(ticks)”Like delay(), returns a Promise that resolves after a number of ticks. Useful inside async functions.
| Parameter | Type | Description |
|---|---|---|
ticks | number | Ticks to wait |
Returns: Promise<void>
async function phaseTransition() { broadcast('<yellow>Phase 2 starting in 5 seconds...'); await Game.scheduler.afterAsync(100); broadcast('<red>Phase 2 has begun!');}Game.hud
Section titled “Game.hud”Manage HUD elements: action bars, boss bars, sidebars, and toast notifications.
BossBarOpts Interface
Section titled “BossBarOpts Interface”| Property | Type | Default | Description |
|---|---|---|---|
title | string | — | Boss bar title (MiniMessage format) |
progress | number | 1.0 | Fill amount from 0.0 to 1.0 |
color | string | 'white' | Bar color: 'pink', 'blue', 'red', 'green', 'yellow', 'purple', 'white' |
duration | number | 0 | Auto-remove after this many ticks (0 = permanent) |
SidebarOpts Interface
Section titled “SidebarOpts Interface”| Property | Type | Default | Description |
|---|---|---|---|
id | string | — | Unique identifier for this sidebar |
title | string | — | Sidebar title (MiniMessage format) |
lines | string[] | — | Array of lines (MiniMessage format) |
duration | number | 0 | Auto-remove after ticks (0 = permanent) |
ToastOpts Interface
Section titled “ToastOpts Interface”| Property | Type | Description |
|---|---|---|
title | string | Toast title (MiniMessage format) |
description | string | Toast description (MiniMessage format) |
Methods
Section titled “Methods”actionBar(player, text, duration?)
Section titled “actionBar(player, text, duration?)”Displays a persistent action bar message with an optional duration.
| Parameter | Type | Default | Description |
|---|---|---|---|
player | any | — | Target player |
text | string | — | MiniMessage text |
duration | number | 60 | Duration in ticks |
Game.hud.actionBar(player, '<gold>Mining Zone <gray>- <green>2x XP Active', 200);bossBar(player, id, opts)
Section titled “bossBar(player, id, opts)”Creates or updates a boss bar for a player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
id | string | Unique ID for this boss bar |
opts | BossBarOpts | Boss bar configuration |
// Event timer boss barGame.hud.bossBar(player, 'event-timer', { title: '<gold>Legendary Raid <gray>- <white>4:59 remaining', progress: 1.0, color: 'yellow', duration: 0});
// Update progress over timelet timeLeft = 6000; // 5 minutes in ticksconst timerHandle = Game.scheduler.every(20, () => { timeLeft -= 20; const progress = timeLeft / 6000; const seconds = Math.floor(timeLeft / 20); const mins = Math.floor(seconds / 60); const secs = seconds % 60; const timeStr = `${mins}:${String(secs).padStart(2, '0')}`;
Game.hud.bossBar(player, 'event-timer', { title: `<gold>Legendary Raid <gray>- <white>${timeStr} remaining`, progress: Math.max(0, progress), color: progress > 0.3 ? 'yellow' : 'red' });
if (timeLeft <= 0) { timerHandle.cancel(); Game.hud.removeBossBar(player, 'event-timer'); }});removeBossBar(player, id)
Section titled “removeBossBar(player, id)”Removes a boss bar by ID.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
id | string | Boss bar ID to remove |
Game.hud.removeBossBar(player, 'event-timer');sidebar(player, opts)
Section titled “sidebar(player, opts)”Displays a scoreboard-style sidebar for a player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
opts | SidebarOpts | Sidebar configuration |
// Quest progress sidebarGame.hud.sidebar(player, { id: 'quest-progress', title: '<gold><bold>Active Quest', lines: [ '<gray>Catch 3 Water Pokemon', `<white>Progress: <aqua>${caught}/3`, '', '<gray>Reward: <yellow>500 Coins' ], duration: 0});
// Update it as progress changesGame.hud.sidebar(player, { id: 'quest-progress', title: '<gold><bold>Active Quest', lines: [ '<gray>Catch 3 Water Pokemon', `<white>Progress: <green>${caught}/3 <green>COMPLETE`, '', '<gray>Reward: <yellow>500 Coins' ]});removeSidebar(player, id)
Section titled “removeSidebar(player, id)”Removes a sidebar by ID.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
id | string | Sidebar ID to remove |
Game.hud.removeSidebar(player, 'quest-progress');toast(player, opts)
Section titled “toast(player, opts)”Displays a toast notification (the popup that appears in the upper-right corner, like advancement notifications).
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
opts | ToastOpts | Toast configuration |
// Achievement unlocked toastGame.hud.toast(player, { title: '<gold>Achievement Unlocked!', description: '<gray>Caught your first Shiny Pokemon'});
// Quest complete toastGame.hud.toast(player, { title: '<green>Quest Complete', description: '<white>Viridian Forest Explorer'});clear(player)
Section titled “clear(player)”Removes all HUD elements (boss bars, sidebars, action bars) from a player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
// Clean slateGame.hud.clear(player);Game.camera
Section titled “Game.camera”Control cinematic camera paths and orbits for players.
OrbitOpts Interface
Section titled “OrbitOpts Interface”| Property | Type | Default | Description |
|---|---|---|---|
radius | number | 5.0 | Orbit radius in blocks |
height | number | 2.0 | Camera height above the target |
speed | number | 1.0 | Orbit speed multiplier |
startAngle | number | 0 | Starting angle in degrees |
Methods
Section titled “Methods”play(player, pathId)
Section titled “play(player, pathId)”Plays a predefined camera path for a player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
pathId | string | Camera path identifier |
// Play a cutscene camera pathGame.camera.play(player, 'intro-flyover');stop(player)
Section titled “stop(player)”Stops the current camera path and returns control to the player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
Game.camera.stop(player);isPlaying(player)
Section titled “isPlaying(player)”Checks if a camera path is currently playing for a player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
Returns: boolean
if (Game.camera.isPlaying(player)) { msg(player, '<gray>Press SHIFT to skip cutscene');}orbit(player, target, opts?)
Section titled “orbit(player, target, opts?)”Starts an orbiting camera around a target position.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
target | Vec3Like | Position to orbit around |
opts | OrbitOpts | Orbit settings |
// Cinematic orbit around a boss arenaGame.camera.orbit(player, arenaCenter, { radius: 15.0, height: 8.0, speed: 0.5, startAngle: 0});
// Slow dramatic revealGame.camera.orbit(player, monumentPos, { radius: 25.0, height: 12.0, speed: 0.3, startAngle: 90});stopOrbit(player)
Section titled “stopOrbit(player)”Stops the orbiting camera for a player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
Game.camera.stopOrbit(player);isOrbiting(player)
Section titled “isOrbiting(player)”Checks if the camera is currently orbiting for a player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
Returns: boolean
if (Game.camera.isOrbiting(player)) { Game.camera.stopOrbit(player);}paths()
Section titled “paths()”Lists all registered camera path IDs.
Returns: string[]
const allPaths = Game.camera.paths();console.log('Available camera paths:', allPaths.join(', '));Game.regions
Section titled “Game.regions”Query Ceremony’s region system. Regions are defined in Ceremony’s configuration and can represent areas like towns, arenas, dungeons, and more.
Methods
Section titled “Methods”get(regionId)
Section titled “get(regionId)”Gets a region by its ID.
| Parameter | Type | Description |
|---|---|---|
regionId | string | Region identifier |
Returns: Region | null
const spawn = Game.regions.get('spawn-area');isPlayerIn(player, regionId)
Section titled “isPlayerIn(player, regionId)”Checks if a player is inside a specific region.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
regionId | string | Region identifier |
Returns: boolean
if (Game.regions.isPlayerIn(player, 'pvp-arena')) { msg(player, '<red>PvP is enabled in this area!');}isPlayerInTagged(player, tag)
Section titled “isPlayerInTagged(player, tag)”Checks if a player is inside any region with a specific tag.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
tag | string | Region tag to check |
Returns: boolean
// Check if the player is in any "safe-zone" tagged regionif (Game.regions.isPlayerInTagged(player, 'safe-zone')) { Game.combat.heal(player, 1.0);}getPlayerRegions(player)
Section titled “getPlayerRegions(player)”Gets all regions the player is currently inside.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
Returns: Region[]
const regions = Game.regions.getPlayerRegions(player);for (const region of regions) { console.log(`Player is in region: ${region.getId()}`);}list()
Section titled “list()”Lists all registered regions.
Returns: Region[]
const allRegions = Game.regions.list();msg(player, `<gray>Total regions: <white>${allRegions.length}`);Game.display
Section titled “Game.display”Create and manage floating hologram text displays in the world.
Methods
Section titled “Methods”hologram(level, pos, text)
Section titled “hologram(level, pos, text)”Creates a hologram visible to all players.
| Parameter | Type | Description |
|---|---|---|
level | any | Server level |
pos | Vec3Like | World position |
text | string | Display text (MiniMessage format) |
Returns: string — Hologram ID
// Floating label above a shopconst shopLabel = Game.display.hologram(level, { x: 100, y: 67, z: 200 }, '<gold><bold>Pokemon Mart\n<gray>Right-click to open');hologramForPlayer(player, pos, text)
Section titled “hologramForPlayer(player, pos, text)”Creates a hologram visible only to a specific player.
| Parameter | Type | Description |
|---|---|---|
player | any | Target player |
pos | Vec3Like | World position |
text | string | Display text (MiniMessage format) |
Returns: string — Hologram ID
// Personal quest markerconst markerId = Game.display.hologramForPlayer(player, { x: 250, y: 70, z: 100 }, '<yellow>Quest Objective\n<gray>Talk to Professor Oak');remove(id)
Section titled “remove(id)”Removes a hologram by its ID.
| Parameter | Type | Description |
|---|---|---|
id | string | Hologram ID to remove |
Game.display.remove(shopLabel);get(id)
Section titled “get(id)”Gets a hologram by its ID.
| Parameter | Type | Description |
|---|---|---|
id | string | Hologram ID |
Returns: Display | null
const display = Game.display.get(shopLabel);list()
Section titled “list()”Lists all active holograms.
Returns: Display[]
const displays = Game.display.list();msg(player, `<gray>Active holograms: <white>${displays.length}`);Game.events
Section titled “Game.events”Subscribe to and unsubscribe from game events. This is the same API available as the top-level Events global.
Methods
Section titled “Methods”on(event, callback)
Section titled “on(event, callback)”Registers an event listener.
| Parameter | Type | Description |
|---|---|---|
event | string | Event name (e.g., 'PlayerJoinEvent') |
callback | function | Function to call when the event fires |
Returns: string — Subscription ID
const subId = Game.events.on('PlayerJoinEvent', (event) => { const player = wrapPlayer(event.getEntity()); msg(player, '<green>Welcome!');});off(subscriptionId)
Section titled “off(subscriptionId)”Unregisters an event listener by its subscription ID.
| Parameter | Type | Description |
|---|---|---|
subscriptionId | string | ID returned by on() |
Game.events.off(subId);One-shot event pattern:
// Listen for a single event, then unsubscribeconst subId = Events.on('PlayerJoinEvent', (event) => { const player = wrapPlayer(event.getEntity()); msg(player, '<gold>You are the first player to join!'); Events.off(subId);});Game.state
Section titled “Game.state”Persistent global key-value storage that survives server restarts. This is the same API available as the top-level State global.
Methods
Section titled “Methods”get(key)
Section titled “get(key)”Retrieves a value from state storage.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns: string | null
const eventActive = Game.state.get('legendary-event-active');set(key, value)
Section titled “set(key, value)”Stores a key-value pair.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
value | string | Value to store |
Game.state.set('legendary-event-active', 'true');Game.state.set('server-launch-date', '2025-01-15');has(key)
Section titled “has(key)”Checks if a key exists in state storage.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns: boolean
if (!Game.state.has('server-initialized')) { // First-time server setup Game.state.set('server-initialized', 'true'); broadcast('<gold>Server initialized for the first time!');}remove(key)
Section titled “remove(key)”Removes a key-value pair from state storage.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key to remove |
Game.state.remove('legendary-event-active');keys()
Section titled “keys()”Gets all keys currently in state storage.
Returns: string[]
const allKeys = Game.state.keys();console.log('State keys:', allKeys.join(', '));Practical example — server-wide kill counter:
function onEnable() { Events.on('PlayerKillEntityEvent', (event) => { const current = parseInt(Game.state.get('total-mob-kills') || '0'); Game.state.set('total-mob-kills', (current + 1).toString());
// Milestone announcement every 1000 kills if ((current + 1) % 1000 === 0) { broadcast(`<gold>Server Milestone: <white>${current + 1} <gold>total mob kills!`); } });}Game.world
Section titled “Game.world”The Game.world namespace provides methods for interacting with the world — placing blocks, reading block states, controlling time and weather, and creating environmental effects.
Game.world.getBlock(level, pos)
Section titled “Game.world.getBlock(level, pos)”Get the block state at a position.
Parameters: level (ServerLevel), pos (BlockPos)
Returns: BlockState
const state = Game.world.getBlock(level, pos);const blockId = state.getBlock().toString();Game.world.setBlock(level, pos, blockId)
Section titled “Game.world.setBlock(level, pos, blockId)”Set a block at a position by its registry ID.
Parameters: level (ServerLevel), pos (BlockPos), blockId (string)
Game.world.setBlock(level, pos, 'minecraft:diamond_block');Game.world.fillBlocks(level, from, to, blockId)
Section titled “Game.world.fillBlocks(level, from, to, blockId)”Fill a rectangular region with a block type.
Parameters: level (ServerLevel), from (BlockPos), to (BlockPos), blockId (string)
// Fill a 5x5x1 platform with stoneGame.world.fillBlocks(level, from, to, 'minecraft:stone');Game.world.getTime(level)
Section titled “Game.world.getTime(level)”Get the current world time in ticks.
Parameters: level (ServerLevel)
Returns: number
const time = Game.world.getTime(level);const isNight = time > 13000 && time < 23000;Game.world.setTime(level, ticks)
Section titled “Game.world.setTime(level, ticks)”Set the world time.
Parameters: level (ServerLevel), ticks (number)
Game.world.setTime(level, 6000); // Set to noonGame.world.getWeather(level)
Section titled “Game.world.getWeather(level)”Get the current weather state as a string.
Parameters: level (ServerLevel)
Returns: string — "clear", "rain", or "thunder"
const weather = Game.world.getWeather(level);if (weather === 'thunder') { broadcast('<yellow>A storm is raging!');}Game.world.setWeather(level, weather)
Section titled “Game.world.setWeather(level, weather)”Set the world weather.
Parameters: level (ServerLevel), weather (string) — "clear", "rain", or "thunder"
Game.world.setWeather(level, 'rain');Game.world.explosion(level, pos, power)
Section titled “Game.world.explosion(level, pos, power)”Create an explosion at a position.
Parameters: level (ServerLevel), pos (Vec3), power (number)
Game.world.explosion(level, player.position(), 4.0);Game.world.playSound(level, pos, sound)
Section titled “Game.world.playSound(level, pos, sound)”Play a sound at a world position (audible to all nearby players).
Parameters: level (ServerLevel), pos (Vec3), sound (string)
Game.world.playSound(level, pos, 'minecraft:entity.wither.spawn');Game.items
Section titled “Game.items”The Game.items namespace provides methods for creating, giving, taking, and inspecting items in player inventories.
Game.items.create(itemId, count)
Section titled “Game.items.create(itemId, count)”Create an ItemStack from a registry ID and count.
Parameters: itemId (string), count (number)
Returns: ItemStack
const stack = Game.items.create('minecraft:diamond', 64);Game.items.give(player, itemId, count)
Section titled “Game.items.give(player, itemId, count)”Give an item to a player’s inventory.
Parameters: player (ServerPlayer), itemId (string), count (number)
Game.items.give(player, 'minecraft:golden_apple', 5);Game.items.take(player, itemId, count)
Section titled “Game.items.take(player, itemId, count)”Remove items from a player’s inventory.
Parameters: player (ServerPlayer), itemId (string), count (number)
Game.items.take(player, 'minecraft:diamond', 3);Game.items.has(player, itemId)
Section titled “Game.items.has(player, itemId)”Check if a player has a specific item in their inventory.
Parameters: player (ServerPlayer), itemId (string)
Returns: boolean
if (Game.items.has(player, 'minecraft:nether_star')) { msg(player, '<green>You have the key!');}Game.items.getMainHand(player)
Section titled “Game.items.getMainHand(player)”Get the item currently in the player’s main hand.
Parameters: player (ServerPlayer)
Returns: ItemStack
const held = Game.items.getMainHand(player);Game.items.getOffHand(player)
Section titled “Game.items.getOffHand(player)”Get the item in the player’s off hand.
Parameters: player (ServerPlayer)
Returns: ItemStack
const shield = Game.items.getOffHand(player);Game.items.getArmor(player, slot)
Section titled “Game.items.getArmor(player, slot)”Get the armor item in a specific slot.
Parameters: player (ServerPlayer), slot (string) — "HEAD", "CHEST", "LEGS", or "FEET"
Returns: ItemStack
const helmet = Game.items.getArmor(player, 'HEAD');Game.items.getInventory(player)
Section titled “Game.items.getInventory(player)”Get the full inventory contents as an array of ItemStacks.
Parameters: player (ServerPlayer)
Returns: ItemStack[]
const inv = Game.items.getInventory(player);const diamondCount = inv.filter(s => s.toString().includes('diamond')).length;Game.items.drop(level, pos, itemId, count)
Section titled “Game.items.drop(level, pos, itemId, count)”Drop an item entity at a world position.
Parameters: level (ServerLevel), pos (Vec3), itemId (string), count (number)
Game.items.drop(level, player.position(), 'minecraft:emerald', 10);Game.http
Section titled “Game.http”The Game.http namespace provides methods for making HTTP requests from scripts. All methods return Promises and must be used with .then() or async/await.
Game.http.get(url)
Section titled “Game.http.get(url)”Send an HTTP GET request.
Parameters: url (string)
Returns: Promise<Response>
Game.http.get('https://api.example.com/data').then((response) => { const data = JSON.parse(response.body); Logger.info('Received: ' + data.message);});Game.http.post(url, body)
Section titled “Game.http.post(url, body)”Send an HTTP POST request with a JSON body.
Parameters: url (string), body (string)
Returns: Promise<Response>
const payload = JSON.stringify({ player: player.getName(), score: 100 });Game.http.post('https://api.example.com/scores', payload).then((response) => { Logger.info('Score submitted: ' + response.status);});Game.http.put(url, body)
Section titled “Game.http.put(url, body)”Send an HTTP PUT request with a JSON body.
Parameters: url (string), body (string)
Returns: Promise<Response>
Game.http.put('https://api.example.com/players/1', JSON.stringify({ rank: 'elite' })).then((response) => { Logger.info('Updated: ' + response.status);});Game.http.delete(url)
Section titled “Game.http.delete(url)”Send an HTTP DELETE request.
Parameters: url (string)
Returns: Promise<Response>
Game.http.delete('https://api.example.com/sessions/expired').then((response) => { Logger.info('Cleanup: ' + response.status);});Async/await pattern:
async function fetchLeaderboard() { const response = await Game.http.get('https://api.example.com/leaderboard'); const data = JSON.parse(response.body); return data.top10;}Full Namespace Reference
Section titled “Full Namespace Reference”| Namespace | Methods | Purpose |
|---|---|---|
Game.particles | spawn, spawnForPlayer, circle, sphere, line, spiral, beam | Particle effects and shapes |
Game.sounds | play, playAt, sequence, stop | Sound playback and sequencing |
Game.combat | damage, knockback, knockbackFrom, addEffect, removeEffect, hasEffect, heal, entitiesInRadius, entitiesInBox | Combat, effects, and AOE queries |
Game.entities | find, near, nearOfType, spawn, players, playerByName, playerByUUID | Entity lookup, spawning, and queries |
Game.scheduler | after, every, sequence, afterAsync | Tick-based scheduling and sequencing |
Game.hud | actionBar, bossBar, removeBossBar, sidebar, removeSidebar, toast, clear | HUD element management |
Game.camera | play, stop, isPlaying, orbit, stopOrbit, isOrbiting, paths | Camera paths and orbits |
Game.regions | get, isPlayerIn, isPlayerInTagged, getPlayerRegions, list | Region queries |
Game.display | hologram, hologramForPlayer, remove, get, list | Floating text displays |
Game.events | on, off | Event subscription (same as Events) |
Game.state | get, set, has, remove, keys | Persistent state (same as State) |
Game.world | getBlock, setBlock, fillBlocks, getTime, setTime, getWeather, setWeather, explosion, playSound | World manipulation |
Game.items | create, give, take, has, getMainHand, getOffHand, getArmor, getInventory, drop | Item management |
Game.http | get, post, put, delete | HTTP requests (async) |
Related
Section titled “Related”- Global Functions — Top-level convenience functions
- Scripting Introduction — Setup and lifecycle overview
- Your First Script — Hands-on tutorial
- Event System — Journey’s event types for tasks and filters