Player action events fire at precise points during player combat and movement actions. They are defined inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/HarbourMasters/Starship/llms.txt
Use this file to discover all available pages before exploring further.
port/hooks/list/ActionEvent.h and give mods fine-grained control over shooting behaviour, movement mechanics, and bomb usage — including the ability to cancel or modify actions before they take effect.
Event Overview
| Event | When it fires | Cancellable | Key fields |
|---|---|---|---|
PlayerActionBoostEvent | Player activates boost | Yes | player |
PlayerActionBrakeEvent | Player activates brake | Yes | player |
PlayerActionPreShootEvent | Before a laser shot is created | Yes | player, laser |
PlayerActionPostShootEvent | After a laser shot is created | No | player, shot |
PlayerActionPreShootChargedEvent | Before a charged shot is created | Yes | player |
PlayerActionPostShootChargedEvent | After a charged shot is created | No | player |
PlayerActionPreBombEvent | Before a bomb is dropped | Yes | player |
PlayerActionPostBombEvent | After a bomb is dropped | No | player |
Movement Events
PlayerActionBoostEvent
Fires when a player presses the boost button before the engine applies the boost velocity.
Pointer to the
Player struct for the player who is boosting. Access speed, position, and boost meter via this pointer.PlayerActionBrakeEvent
Fires when a player presses the brake button before the engine applies the braking force.
Pointer to the
Player struct for the player who is braking.Movement example — refill boost meter on boost or brake
infinite_boost.c
Laser Events
PlayerActionPreShootEvent
Fires before the engine allocates the PlayerShot struct. This is the correct place to modify which laser type will be fired, or to cancel the shot entirely.
Pointer to the shooting
Player struct.The laser type that will be fired (e.g.
LASERS_SINGLE, LASERS_TWIN, LASERS_HYPER). Modify this field to change the laser type before the shot object is created.PlayerActionPostShootEvent
Fires after the engine has created the PlayerShot object. Use this to modify properties of the shot — such as range, speed, or damage — without preventing the shot from firing.
Pointer to the shooting
Player struct.Pointer to the newly created
PlayerShot struct. Modify shot->timer to change how long the shot travels before expiring, effectively adjusting laser range.PlayerActionPostShootEvent is not cancellable — the shot has already been committed to the object pool. Use PlayerActionPreShootEvent if you need to prevent the shot from being created.Laser range multiplier example
This pattern mirrors how the built-ingLaserRangeMult CVar works in PortEnhancements.c:
laser_range.c
Upgrading laser type before firing
force_hyper_laser.c
Charged Shot Events
PlayerActionPreShootChargedEvent
Fires before the engine creates a charged shot. Cancel to prevent the charged shot from firing.
Pointer to the
Player struct that is releasing the charged shot.PlayerActionPostShootChargedEvent
Fires after the charged shot has been created. The shot object is already in the pool.
Pointer to the
Player struct that released the charged shot.charged_shot_hook.c
Bomb Events
PlayerActionPreBombEvent
Fires before the engine drops a bomb. Cancel to consume the input without spending a bomb, or to redirect the bomb drop to custom logic.
Pointer to the
Player struct about to drop a bomb.PlayerActionPostBombEvent
Fires after the bomb has been placed in the world. The bomb object is already active.
Pointer to the
Player struct that dropped the bomb.bomb_hook.c
Complete Example — Laser Behaviour Mod
The following mod combines pre- and post-shoot events to both upgrade the laser type and extend its range, replicating and extending the pattern fromPortEnhancements.c:
laser_mod.c