CombatSimulator
Combat Simulator - Manages test dummies and simulates attacks for skill testing.
Uses a singleton dummy pattern - one dummy at a time, killed and replaced between weapon types.
ATTACK SIMULATION:
- simulateMeleeAttack() - Uses player.attack(target), resets iframes before each hit
- simulateRangedAttack() - Spawns arrow toward target, needs tick delay for travel
- simulateTridentAttack() - Spawns trident toward target, needs tick delay for travel
- simulateIncomingDamage() - For armor skills, calls player.damage(amount, attacker)
CONFIG REQUIREMENTS:
- training_dummy.yml - For offensive skill tests (damageMultiplier can be 0)
- training_dummy_combat.yml - For armor skill tests (needs damageMultiplier >0)
See also
- The main test orchestrator
Properties
Functions
Link copied to clipboard
Applies passive weapon effects that normally trigger on PlayerItemHeldEvent.
Link copied to clipboard
public static double calculateExpectedDefensiveDamage(int armorSkillLevel, int mobLevel, Player player)
Calculates the expected defensive damage (elite → player) from the formula constants.
Link copied to clipboard
Cleans up any projectile entities and area-effect-clouds spawned near the test area.
Link copied to clipboard
Equips the player with a full armor set at the specified elite level.
Link copied to clipboard
Equips the player with a weapon appropriate for the skill type.
Link copied to clipboard
Gets a dummy by skill ID.
Link copied to clipboard
Gets the number of active dummies.
Link copied to clipboard
Gets the living entity for a dummy.
Link copied to clipboard
When >= 0, bypasses the defense formula in PlayerDamagedByEliteMobEvent and uses this fixed damage value instead.
Link copied to clipboard
Checks if the player has an active damage breakdown tracking session.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Updates a dummy's name to show the test failed.
Link copied to clipboard
public void markDummyAsPassed(String skillId, String skillName, SkillType skillType, double procRate)
Updates a dummy's name to show the test passed.
Link copied to clipboard
Updates a dummy's name to show it's currently being tested.
Link copied to clipboard
Places a water block at the dummy's feet for testing water-dependent skills (Depth Charge).
Link copied to clipboard
Removes all dummies.
Link copied to clipboard
Removes a specific dummy by skill ID.
Link copied to clipboard
Clears projectile tracking state.
Link copied to clipboard
Respawns a dummy if it died.
Link copied to clipboard
Restores the player's saved armor.
Link copied to clipboard
Restores the original block material at the water placement location.
Link copied to clipboard
Runs a quick damage test and outputs the results.
Link copied to clipboard
Saves the player's current armor for later restoration.
Link copied to clipboard
Outputs a detailed damage breakdown to the player.
Link copied to clipboard
Link copied to clipboard
Sets a dummy's health to a percentage of its max health.
Link copied to clipboard
When >= 0, bypasses the defense formula in PlayerDamagedByEliteMobEvent and uses this fixed damage value instead.
Link copied to clipboard
Link copied to clipboard
Simulates the player taking damage while blocking.
Link copied to clipboard
Performs a direct event-based attack with critical strike flag set to true.
Link copied to clipboard
Performs a direct event-based attack against a specific dummy.
Link copied to clipboard
Simulates the player taking fatal damage without absorption buffer.
Link copied to clipboard
Simulates incoming high damage with override for skills with high damage thresholds.
Link copied to clipboard
Simulates the player taking damage from a specific dummy (for armor skill testing).
Simulates incoming damage with the player at a specified health percentage.
Link copied to clipboard
Simulates incoming damage with the test damage override enabled.
Link copied to clipboard
Kills a dummy with a real player swing, so the whole death chain actually runs.
Link copied to clipboard
Performs a melee attack against a specific dummy.
Link copied to clipboard
Performs a melee attack with full damage breakdown tracking.
Link copied to clipboard
Performs multiple melee attacks and returns an averaged breakdown summary.
Link copied to clipboard
Performs a ranged attack (bow/crossbow) against a specific dummy.
Link copied to clipboard
Performs a trident throw attack against a specific dummy.
Link copied to clipboard
Spawns the dedicated damage test dummy for baseline damage validation.
Link copied to clipboard
Spawns a single dummy for the current skill test.
Link copied to clipboard
Stops breakdown tracking and returns the result.