Testing & Troubleshooting
Testing & Troubleshooting
Section titled “Testing & Troubleshooting”Complete guide to testing Titan configurations, debugging issues, and performance optimization.
In-Game Testing
Section titled “In-Game Testing”Creating Test Titans
Section titled “Creating Test Titans”# 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 nameTesting Checklist
Section titled “Testing Checklist”-
Phase Transitions
- Damage Titan to each health threshold
- Verify modifiers apply (speed, damage, scale)
- Check phase scripts execute (particles, sounds)
-
Move Execution
- Observe move selection patterns
- Confirm cooldowns respected
- Verify conditions evaluated correctly
-
Movement Controllers
- Watch AI behavior matches expected pattern
- Test phase-specific movement overrides
- Verify safe navigation (no stuck states)
-
ActionEffect Timelines
- Check telegraph warnings appear
- Verify damage hitboxes align with visuals
- Confirm vulnerability windows activate
-
Particles & Sounds
- Visual effects spawn correctly
- Sounds play at right volume/pitch
- No particle spam/lag
Commands for Testing
Section titled “Commands for Testing”# 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]Runtime Logging
Section titled “Runtime Logging”Enable Debug Logs
Section titled “Enable Debug Logs”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>Key Log Messages
Section titled “Key Log Messages”Movement Controllers
Section titled “Movement Controllers”[DEBUG] [HIT AND RUN] Entering APPROACH phase[DEBUG] [HIT AND RUN] Transitioning to STRIKE[DEBUG] [HIT AND RUN] Executing RETREAT to safe distanceTeleportation
Section titled “Teleportation”[DEBUG] Teleport adjusted by EntityBounds: from [x, y, z] to [x', y', z']Indicates post-teleport collision correction.
Vulnerability Transitions
Section titled “Vulnerability Transitions”[DEBUG] Titan entering VULNERABLE state: type=EXHAUSTED, mult=2.0, duration=3000ms[DEBUG] Titan cleared VULNERABLE statePerformance Monitoring
Section titled “Performance Monitoring”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 tickCommon Issues & Fixes
Section titled “Common Issues & Fixes”Attribute Modifier Crash
Section titled “Attribute Modifier Crash”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.
Titan Stuck in Water
Section titled “Titan Stuck in Water”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)Moves Not Executing
Section titled “Moves Not Executing”Symptom: Titan stands idle, doesn’t use moves.
Possible Causes:
-
All moves on cooldown
- Check move
cooldownvalues - Verify cooldowns aren’t too long
- Use
TitanMoveSelectionTask.clearCooldowns()on interrupt
- Check move
-
Conditions failing
- Review move
conditionMoLang expressions - Check logs for condition evaluation errors
- Test with
condition: "1.0"(always true)
- Review move
-
Phase mismatch
- Verify current health matches phase thresholds
- Check
minHealthPercent/maxHealthPercentranges - Ensure at least one move available per phase
-
No target
- Titan requires player target to select moves
- Check aggro range
- Verify player is not in spectator mode
ActionEffect Keyframes Not Firing
Section titled “ActionEffect Keyframes Not Firing”Symptom: Telegraph appears but no damage, or particles missing.
Possible Causes:
-
Timing mismatch
startTickstoo early/late in timeline- Titan interrupted before keyframe executes
- Phase transition cancelled timeline
-
Invalid MoLang
- Syntax errors in
expressionfield - Undefined query function
- Check server logs for MoLang errors
- Syntax errors in
-
Missing damage registration
DefineOBBKeyframenot called beforeDamageOBBKeyframe- 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 } ]}Particles Not Appearing
Section titled “Particles Not Appearing”Symptom: MoLang particle_effect() doesn’t spawn particles.
Possible Causes:
-
Invalid Identifier
- Typo in particle ID
- Cobblemon particle doesn’t exist
- Check
assets/cobblemon/bedrock/particles/
-
Player too far
- Render distance =
spread × 2 - If
spread: 2.0, max distance = 4 blocks - Increase spread for larger areas
- Render distance =
-
Position out of bounds
q.position()returns NaN- Offset math error
- Verify with logs
Debug:
// Add logging before particleq.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)
Phase Modifiers Not Applying
Section titled “Phase Modifiers Not Applying”Symptom: Titan doesn’t get faster/stronger in later phases.
Possible Causes:
-
Phase threshold not crossed
- Verify
healthThresholdvalues (1.0, 0.66, 0.33) - Check current health percentage
- Phases trigger on health drop, not static value
- Verify
-
Modifier calculation error
speedModifier,damageModifier,scaleModifiermust be > 0.1- Check JSON syntax (no quotes around numbers)
-
Phase scripts failing
onEnterScripthas MoLang error- Script exception prevents modifier application
- Check logs for script errors
Verification:
# 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 getPerformance Tuning
Section titled “Performance Tuning”Optimization Checklist
Section titled “Optimization Checklist”-
Reduce Particle Count
- Lower
countparameter (aim for <150 per effect) - Increase keyframe intervals (every 6-10 ticks, not every tick)
- Lower
-
Throttle Component Updates
- Default: 20 ticks (1 second)
- Increase for lower-priority checks (40-60 ticks)
-
Limit Active Titans
- Use
TitanFightManager.hasActiveFights()check - Despawn defeated titans promptly
- Avoid spawning multiple titans simultaneously
- Use
-
Optimize ActionEffects
- Remove unnecessary keyframes
- Combine multiple small damages into one larger hit
- Reduce telegraph particle density
-
Movement Controller Selection
- Simplify weight calculations
- Cache distance/health checks
- Reduce number of navigation updates
Performance Metrics
Section titled “Performance Metrics”Target Frame Times:
- Single Titan: <5ms impact on TPS
- Multiple Titans (3-5): <15ms total
- Large Battles (10+): May require throttling
Monitor:
/forge tps # Forge/spark tps # Spark profiler/timings # Paper/SpigotValidation Best Practices
Section titled “Validation Best Practices”- Test each phase individually (spawn titan at different HP)
- Verify all moves execute at least once
- Check logs for MoLang/keyframe errors
- Monitor performance with profiler during large battles
Debugging Workflow
Section titled “Debugging Workflow”-
Reproduce Issue
- Create minimal test case
- Isolate specific move/phase/controller
-
Enable Debug Logging
- Set
aster.amo.titanlogger todebug - Restart server
- Set
-
Review Logs
- Check for exceptions
- Look for unexpected state transitions
- Verify keyframe execution order
-
Test Fix
- Edit config files
- Verify issue resolved
-
Validate
- Test in full fight scenario
- Monitor for regressions
Example Debug Session
Section titled “Example Debug Session”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.
Next Steps
Section titled “Next Steps”- Performance Tuning → - Optimize titan difficulty
- Action Effect Builder → - Visual timeline editor
- MoLang Reference → - Query function docs
Thorough testing ensures epic, bug-free boss encounters!