Skip to content

Testing & Troubleshooting

Complete guide to testing Titan configurations, debugging issues, and performance optimization.

Terminal window
# Spawn a specific Pokemon
/summon cobblemon:pokemon ~ ~ ~ {Species:"charizard",Level:50}
# Convert to Titan
/titan create @e[type=cobblemon:pokemon,limit=1,sort=nearest]
# Verify titan property applied
# Entity should show "[TITAN]" prefix in name
  1. Phase Transitions

    • Damage Titan to each health threshold
    • Verify modifiers apply (speed, damage, scale)
    • Check phase scripts execute (particles, sounds)
  2. Move Execution

    • Observe move selection patterns
    • Confirm cooldowns respected
    • Verify conditions evaluated correctly
  3. Movement Controllers

    • Watch AI behavior matches expected pattern
    • Test phase-specific movement overrides
    • Verify safe navigation (no stuck states)
  4. ActionEffect Timelines

    • Check telegraph warnings appear
    • Verify damage hitboxes align with visuals
    • Confirm vulnerability windows activate
  5. Particles & Sounds

    • Visual effects spawn correctly
    • Sounds play at right volume/pitch
    • No particle spam/lag
Terminal window
# Clear all active titans (cleanup)
/kill @e[type=cobblemon:pokemon,tag=titan]
# Teleport to titan
/tp @p @e[type=cobblemon:pokemon,tag=titan,limit=1]
# Set titan health (testing phases)
/data modify entity @e[type=cobblemon:pokemon,tag=titan,limit=1] Health set value 100.0f
# Check titan data
/data get entity @e[type=cobblemon:pokemon,tag=titan,limit=1]

File: config/log4j2.xml (or server logging config)

<Configuration>
<Loggers>
<Logger name="aster.amo.titan" level="debug" additivity="false">
<AppenderRef ref="ServerGuiConsole"/>
<AppenderRef ref="File"/>
</Logger>
</Loggers>
</Configuration>
[DEBUG] [HIT AND RUN] Entering APPROACH phase
[DEBUG] [HIT AND RUN] Transitioning to STRIKE
[DEBUG] [HIT AND RUN] Executing RETREAT to safe distance
[DEBUG] Teleport adjusted by EntityBounds: from [x, y, z] to [x', y', z']

Indicates post-teleport collision correction.

[DEBUG] Titan entering VULNERABLE state: type=EXHAUSTED, mult=2.0, duration=3000ms
[DEBUG] Titan cleared VULNERABLE state

The system throttles component updates to every 20 ticks (1 second) by default to optimize performance.

Monitor:

[DEBUG] TitanFightManager tick: 5 active fights
[DEBUG] TitanFightManager: No active fights, skipping tick

Symptom: Server crashes with IllegalArgumentException: Attribute modifier already exists.

Cause: Duplicate attribute modifiers with same UUID.

Fix: The system now removes existing modifiers before applying new ones to prevent this crash.

Symptom: Teleport Blink moves Titan into water repeatedly.

Cause: Candidate filtering not checking fluid blocks.

Fix: The teleport system now filters out water and lava blocks when selecting teleport destinations.

Verification:

[DEBUG] TeleportBlink: Filtered 12 candidates to 8 (removed fluids)

Symptom: Titan stands idle, doesn’t use moves.

Possible Causes:

  1. All moves on cooldown

    • Check move cooldown values
    • Verify cooldowns aren’t too long
    • Use TitanMoveSelectionTask.clearCooldowns() on interrupt
  2. Conditions failing

    • Review move condition MoLang expressions
    • Check logs for condition evaluation errors
    • Test with condition: "1.0" (always true)
  3. Phase mismatch

    • Verify current health matches phase thresholds
    • Check minHealthPercent / maxHealthPercent ranges
    • Ensure at least one move available per phase
  4. No target

    • Titan requires player target to select moves
    • Check aggro range
    • Verify player is not in spectator mode

Symptom: Telegraph appears but no damage, or particles missing.

Possible Causes:

  1. Timing mismatch

    • startTicks too early/late in timeline
    • Titan interrupted before keyframe executes
    • Phase transition cancelled timeline
  2. Invalid MoLang

    • Syntax errors in expression field
    • Undefined query function
    • Check server logs for MoLang errors
  3. Missing damage registration

    • DefineOBBKeyframe not called before DamageOBBKeyframe
    • Telegraph ID mismatch
    • Check OBB definition order

Fix:

{
"keyframes": [
{
"type": "titan:define_obb",
"startTicks": 0,
"id": "slash_1",
"shape": "CONE",
"dimensions": [6.0, 4.0, 90.0]
},
{
"type": "titan:telegraph_obb",
"startTicks": 5,
"id": "slash_1",
"severity": "WARNING",
"durationTicks": 15
},
{
"type": "titan:damage_obb",
"startTicks": 20,
"id": "slash_1", // MUST match define_obb ID
"damage": 15.0
}
]
}

Symptom: MoLang particle_effect() doesn’t spawn particles.

Possible Causes:

  1. Invalid Identifier

    • Typo in particle ID
    • Cobblemon particle doesn’t exist
    • Check assets/cobblemon/bedrock/particles/
  2. Player too far

    • Render distance = spread × 2
    • If spread: 2.0, max distance = 4 blocks
    • Increase spread for larger areas
  3. Position out of bounds

    • q.position() returns NaN
    • Offset math error
    • Verify with logs

Debug:

// Add logging before particle
q.log('Spawning at: ' + q.position(0));
q.particle_effect('cobblemon:flame_burst', q.position(0), 100, 3.0)

(Note: q.log() may not exist; use debug logging in code instead)

Symptom: Titan doesn’t get faster/stronger in later phases.

Possible Causes:

  1. Phase threshold not crossed

    • Verify healthThreshold values (1.0, 0.66, 0.33)
    • Check current health percentage
    • Phases trigger on health drop, not static value
  2. Modifier calculation error

    • speedModifier, damageModifier, scaleModifier must be > 0.1
    • Check JSON syntax (no quotes around numbers)
  3. Phase scripts failing

    • onEnterScript has MoLang error
    • Script exception prevents modifier application
    • Check logs for script errors

Verification:

Terminal window
# Watch entity scale change
/data get entity @e[type=cobblemon:pokemon,tag=titan,limit=1] Scale
# Watch speed attribute
/attribute @e[type=cobblemon:pokemon,tag=titan,limit=1] minecraft:generic.movement_speed get
  1. Reduce Particle Count

    • Lower count parameter (aim for <150 per effect)
    • Increase keyframe intervals (every 6-10 ticks, not every tick)
  2. Throttle Component Updates

    • Default: 20 ticks (1 second)
    • Increase for lower-priority checks (40-60 ticks)
  3. Limit Active Titans

    • Use TitanFightManager.hasActiveFights() check
    • Despawn defeated titans promptly
    • Avoid spawning multiple titans simultaneously
  4. Optimize ActionEffects

    • Remove unnecessary keyframes
    • Combine multiple small damages into one larger hit
    • Reduce telegraph particle density
  5. Movement Controller Selection

    • Simplify weight calculations
    • Cache distance/health checks
    • Reduce number of navigation updates

Target Frame Times:

  • Single Titan: <5ms impact on TPS
  • Multiple Titans (3-5): <15ms total
  • Large Battles (10+): May require throttling

Monitor:

Terminal window
/forge tps # Forge
/spark tps # Spark profiler
/timings # Paper/Spigot
  1. Test each phase individually (spawn titan at different HP)
  2. Verify all moves execute at least once
  3. Check logs for MoLang/keyframe errors
  4. Monitor performance with profiler during large battles
  1. Reproduce Issue

    • Create minimal test case
    • Isolate specific move/phase/controller
  2. Enable Debug Logging

    • Set aster.amo.titan logger to debug
    • Restart server
  3. Review Logs

    • Check for exceptions
    • Look for unexpected state transitions
    • Verify keyframe execution order
  4. Test Fix

    • Edit config files
    • Verify issue resolved
  5. Validate

    • Test in full fight scenario
    • Monitor for regressions

Problem: Raichu teleports into water repeatedly.

Investigation:

[DEBUG] TeleportBlink: Evaluating 12 candidates
[DEBUG] TeleportBlink: Selected position [234, 64, -89] (water)
[DEBUG] Titan teleported to [234, 64, -89]

Root Cause: No water filtering in candidate selection.

Fix: Added fluid check to filter out water and lava blocks.

Verification:

[DEBUG] TeleportBlink: Evaluating 12 candidates
[DEBUG] TeleportBlink: Filtered to 8 candidates (removed fluids)
[DEBUG] TeleportBlink: Selected position [230, 65, -85] (grass)

Result: Teleportation now avoids water.


Thorough testing ensures epic, bug-free boss encounters!