Skip to content

Server MoLang Reference

Titan extends Cobblemon’s MoLang with server-side execution through the server_molang keyframe type. This enables powerful scripting within ActionEffect timelines.

Type: server_molang

{
"type": "server_molang",
"expressions": [
"q.play_sound('minecraft:entity.lightning_bolt.thunder', 2.0, 1.0);",
"t.pos = q.position(0);",
"q.particle_effect('cobblemon:thunder_actorcloud', t.pos, 200, 8.0);"
]
}

Key Changes from Old Format:

  • expressions (array) - NEW format
  • expression (string) - OLD format (deprecated)

Global queries and utilities.

q.position(0)
q.play_sound('minecraft:entity.generic.explode', 1.0, 1.0)
q.particle_effect('cobblemon:flame_burst', q.position(0), 100, 3.0)

Functions that operate on the Titan or apply titan-specific effects.

q.titan.apply_potion('minecraft:speed', 100, 1)
q.titan.apply_burn(5.0)
q.titan.apply_wither(3.0)

Query properties about entities in context.

q.entity.is_user // true if entity is the titan, false if target

Store intermediate values for reuse.

t.pos = q.position(0);
q.particle_effect('cobblemon:thunder_actorcloud', t.pos, 200, 8.0);

Returns entity position as array or individual component.

Parameters:

  • component (Number): 0 = [x,y,z] array, 1 = x, 2 = y, 3 = z

Returns: Vec3 array or Number

Examples:

// Get full position
t.pos = q.position(0); // [x, y, z]
// Get individual coordinates
t.x = q.position(1);
t.y = q.position(2);
t.z = q.position(3);
// Use in expressions
q.particle_effect('minecraft:flame', q.position(0) + [0, 1.5, 0], 50, 2.0);

Damages all entities registered in the current damage context (from OBB).

Parameters:

  • amount (Number): Damage to apply

Returns: Void

Examples:

// Fixed damage
q.damage_all(45.0);
// Use move damage
q.damage_all(q.move_damage);
// Combined with sound
q.play_sound('minecraft:entity.generic.explode', 2.0, 0.8);
q.damage_all(100.0);

Usage Context:

{
"type": "damage_obb",
"obbName": "slash_1",
"damage": "50",
"expressions": [
"q.damage_all(50.0);"
]
}

References the damage value configured in the move’s JSON.

Type: Query Variable Returns: Number

Examples:

// Use configured move damage
q.damage_all(q.move_damage);

Move Config:

config/titan/moves/ceruledge.json
{
"armor_oblivion": {
"damage": "120.0", // ← Referenced by q.move_damage
"actionEffect": "titan:ceruledge_armor_oblivion"
}
}

ActionEffect:

{
"type": "damage_obb",
"obbName": "oblivion_sphere",
"damage": "q.move_damage", // ← Uses move config value
"expressions": [
"q.damage_all(q.move_damage);" // ← Same value
]
}

Launches all registered entities upward.

Parameters:

  • power (Number): Upward velocity (1.0 = ~5 blocks, 2.0 = ~10 blocks)

Returns: Void

Examples:

// Light knockup
q.fling_all_up(1.0);
// Heavy knockup
q.fling_all_up(2.4);
// Combined with damage
q.damage_all(80.0);
q.fling_all_up(1.8);

DEPRECATED - Use OBB system instead.

Damages entities in a forward cone.

Parameters:

  • length (Number): Cone length in blocks
  • radius (Number): Cone base radius
  • damage (Number): Damage amount

DEPRECATED - Use OBB system instead.

Damages entities in a sphere.

Parameters:

  • radius (Number): Sphere radius in blocks
  • damage (Number): Damage amount

All titan-specific functions use the q.titan.* namespace.

q.titan.apply_potion(effect, duration, amplifier)

Section titled “q.titan.apply_potion(effect, duration, amplifier)”

Applies a potion effect to the Titan.

Parameters:

  • effect (String): Potion effect ID (e.g., 'minecraft:speed')
  • duration (Number): Duration in ticks (20 = 1 second)
  • amplifier (Number): Effect level (0 = I, 1 = II, etc.)

Returns: Void

Examples:

// Speed II for 5 seconds
q.titan.apply_potion('minecraft:speed', 100, 1);
// Glowing for 5 seconds
q.titan.apply_potion('minecraft:glowing', 100, 0);
// Permanent effect (phase duration)
q.titan.apply_potion('minecraft:speed', 999999, 0);
// Multiple effects
q.titan.apply_potion('minecraft:speed', 999999, 2);
q.titan.apply_potion('minecraft:strength', 999999, 1);
q.titan.apply_potion('minecraft:resistance', 999999, 1);

Common Effects:

  • minecraft:speed - Movement speed
  • minecraft:strength - Attack damage
  • minecraft:resistance - Damage reduction
  • minecraft:regeneration - Health regen
  • minecraft:glowing - Outline effect
  • minecraft:haste - Attack speed

Usage: Phase enter scripts, move buffs

Removes a potion effect from the Titan.

Parameters:

  • effect (String): Potion effect ID

Returns: Void

Examples:

// Remove speed on phase exit
q.titan.remove_potion('minecraft:speed');
// Remove multiple effects
q.titan.remove_potion('minecraft:speed');
q.titan.remove_potion('minecraft:strength');

Usage: Phase exit scripts

Applies burn/fire damage to all registered targets.

Parameters:

  • duration (Number): Burn duration in seconds

Returns: Void

Examples:

// 3 second burn
q.titan.apply_burn(3.0);
// 5 second burn with fling
q.damage_all(q.move_damage);
q.fling_all_up(1.4);
q.titan.apply_burn(5.0);

Applies wither effect to all registered targets.

Parameters:

  • duration (Number): Wither duration in seconds

Returns: Void

Examples:

// 2 second wither
q.titan.apply_wither(2.0);
// Combined damage + wither + burn
q.damage_all(q.move_damage);
q.titan.apply_wither(5.0);
q.titan.apply_burn(5.0);

Applies slowness effect to all registered targets.

Parameters:

  • duration (Number): Slowness duration in seconds

Returns: Void

Examples:

// 4 second slowness
q.titan.apply_slowness(4.0);
// Triple debuff
q.titan.apply_wither(5.0);
q.titan.apply_burn(5.0);
q.titan.apply_slowness(4.0);

Plays a sound at the Titan’s position.

Parameters:

  • sound (String): Sound event ID
  • volume (Number): Volume (0.0-3.0, 1.0 = normal)
  • pitch (Number): Pitch (0.5-2.0, 1.0 = normal)

Returns: Void

Examples:

// Thunder sound
q.play_sound('minecraft:entity.lightning_bolt.thunder', 2.0, 1.0);
// Explosion
q.play_sound('minecraft:entity.generic.explode', 1.0, 0.8);
// Multiple sounds (layered)
q.play_sound('minecraft:entity.wither.spawn', 1.0, 0.5);
q.play_sound('minecraft:entity.ender_dragon.growl', 0.9, 0.6);
// Low pitch for menace
q.play_sound('minecraft:entity.evoker.prepare_summon', 2.0, 0.3);

Common Sounds:

  • minecraft:entity.lightning_bolt.thunder - Thunder
  • minecraft:entity.lightning_bolt.impact - Electric impact
  • minecraft:entity.generic.explode - Explosion
  • minecraft:entity.wither.shoot - Dark projectile
  • minecraft:entity.blaze.shoot - Fire projectile
  • minecraft:entity.ender_dragon.growl - Menacing growl
  • minecraft:entity.evoker.prepare_summon - Charging magic

Spawns particles with automatic Cobblemon snowstorm fallback.

Parameters:

  • id (String): Particle identifier (vanilla or Cobblemon)
  • pos (Vec3): Spawn position (use q.position(0) or temp variable)
  • count (Number): Number of particles (20-300 typical)
  • spread (Number): Spread radius in blocks (determines render distance: spread × 2)

Returns: Void

Examples:

// Basic particle at entity center
q.particle_effect('cobblemon:thunder_actorcloud', q.position(0), 200, 8.0);
// Using temp variable
t.pos = q.position(0);
q.particle_effect('cobblemon:thunder_targetsparks', t.pos, 100, 5.0);
// Offset position (2.5 blocks up)
q.particle_effect('cobblemon:thunder_actorcloud', q.position(0) + [0, 2.5, 0], 180, 3.5);
// Layered particles
q.particle_effect('cobblemon:willowisp_actorwisp', q.position(0), 350, 8.0);
q.particle_effect('cobblemon:eruption_actorlava', q.position(0), 200, 6.0);
q.particle_effect('cobblemon:swordsdance_sparkle', q.position(0), 250, 7.0);
// Vanilla particle
q.particle_effect('minecraft:explosion', q.position(0), 1, 0.0);

Fallback Logic:

  1. Check vanilla registry (minecraft:*)
  2. If not found, use SpawnSnowstormParticlePacket (Cobblemon)
  3. Render radius = spread * 2 (clamped 16-96 blocks)

See: Particles & Visuals →

Type: Query Variable Returns: Boolean

Checks if the current entity context is the Titan (user) or a target.

Examples:

// In entity_particles keyframe
{
"type": "entity_particles",
"entityCondition": "q.entity.is_user == false", // Only targets
"effect": "cobblemon:impact_fire",
"locators": ["target"]
}
// In animation keyframe
{
"type": "animation",
"animation": ["hurt"],
"entityCondition": "q.entity.is_user == false" // Target hurt anim
}

Usage: Filter entity particles/animations to targets only.

Store intermediate values for reuse within the same server_molang keyframe.

Examples:

// Store position
t.pos = q.position(0);
q.particle_effect('cobblemon:thunder_actorcloud', t.pos, 200, 8.0);
q.particle_effect('cobblemon:thunder_targetsparks', t.pos, 100, 5.0);
// Store calculated value
t.damage = q.move_damage * 1.5;
q.damage_all(t.damage);
// Multiple temp vars
t.x = q.position(1);
t.y = q.position(2);
t.z = q.position(3);

Scope: Single server_molang keyframe execution

// Raichu Phase 3 Enter (raichu.json:63)
q.titan.apply_potion('minecraft:speed', 999999, 2);
q.titan.apply_potion('minecraft:strength', 999999, 1);
q.titan.apply_potion('minecraft:resistance', 999999, 1);
q.invoke_move('overcharge');
q.play_sound('minecraft:entity.lightning_bolt.thunder', 1.1, 0.9);
{
"type": "server_molang",
"expressions": [
"q.titan.apply_potion('minecraft:glowing', 100, 0);",
"q.play_sound('minecraft:entity.lightning_bolt.thunder', 0.5, 0.5);",
"t.pos = q.position(0);",
"q.particle_effect('cobblemon:thunder_targetsparks', t.pos, 100, 5.0);"
]
}
{
"type": "damage_obb",
"obbName": "combo_hit",
"damage": "q.move_damage",
"expressions": [
"q.damage_all(q.move_damage);",
"q.fling_all_up(1.4);",
"q.titan.apply_burn(3.0);",
"q.titan.apply_wither(2.0);",
"q.play_sound('minecraft:entity.generic.explode', 1.0, 0.8);"
]
}
// Ceruledge Armor Oblivion final explosion
q.particle_effect('cobblemon:eruption_targetburst', q.position(0), 80, 10.0);
q.particle_effect('cobblemon:willowisp_actorwisp', q.position(0), 500, 12.0);
q.particle_effect('cobblemon:shadowball_actorcharge', q.position(0), 300, 9.0);
q.particle_effect('cobblemon:swordsdance_sparkle', q.position(0), 200, 8.0);
q.particle_effect('cobblemon:impact_ghost', q.position(0), 250, 7.0);
q.particle_effect('cobblemon:eruption_actorlava', q.position(0), 300, 8.0);

Within a server_molang keyframe, expressions execute sequentially in array order:

"expressions": [
"t.pos = q.position(0);", // 1. Store position
"q.play_sound('...', 1.0, 1.0);", // 2. Play sound
"q.particle_effect('...', t.pos, ...);", // 3. Spawn particles (uses t.pos)
"q.damage_all(50.0);" // 4. Deal damage
]
  1. Particle Count - Keep under 300 per effect for client performance
  2. Sound Layering - Limit to 3-4 simultaneous sounds
  3. Temp Variables - Reuse expensive queries (q.position(0))
  4. Expression Count - 5-10 expressions per keyframe is typical

Check:

  • Array format: "expressions": [...] not "expression": "..."
  • Semicolons at end of each expression
  • Quotes around strings
  • Commas between array elements

Check:

  • Particle ID correct (verify in Cobblemon bedrock repository)
  • spread large enough for render distance
  • Position valid (q.position(0) not NaN)

See: Particles & Visuals →

Check:

  • q.damage_all() called within damage_obb keyframe expressions
  • Entities registered in OBB context (defined + telegraphed)
  • Damage value not 0

Master server MoLang to create dynamic, scripted boss attacks!