Buggy code:
public class Shooter { public static void setup ( ) throws ExtendedMotorFailureException { StateMachine shooterStates = new StateMachine ( 0 , "passive" , "ejecting" , "intaking" , "loaded" , "cocking" , "spinup" , "firing" ) ; FloatInput flywheelLowSpeed = mainTuning . getFloat ( "Shooter<seq2seq4repair_space>Flywheel<seq2seq4repair_space>Target<seq2seq4repair_space>Low<seq2seq4repair_space>Speed" , ( - 80.0F ) ) ; FloatInput flywheelHighSpeed = mainTuning . getFloat ( "Shooter<seq2seq4repair_space>Flywheel<seq2seq4repair_space>Target<seq2seq4repair_space>High<seq2seq4repair_space>Speed" , 2750.0F ) ; FloatInput flywheelTargetVelocity = shooterStates . selectByState ( zero , zero , flywheelLowSpeed , zero , zero , flywheelHighSpeed , flywheelHighSpeed ) ; PIDTalon flywheelTalon = new PIDTalon ( Shooter . makeLinkedTalons ( ) , "Shooter<seq2seq4repair_space>Flywheel" , flywheelTargetVelocity . withRamping ( 15.0F , constantPeriodic ) ) ; flywheelTalon . setup ( alwaysTrue ) ; BooleanInput inhaleButton = controlBinding . addBoolean ( "Shooter<seq2seq4repair_space>Intake" ) ; BooleanInput exhaleButton = controlBinding . addBoolean ( "Shooter<seq2seq4repair_space>Eject" ) ; BooleanInput prefireButton = controlBinding . addBoolean ( "Shooter<seq2seq4repair_space>Spinup" ) ; BooleanInput fireButton = controlBinding . addBoolean ( "Shooter<seq2seq4repair_space>Fire" ) ; BooleanInput cancelShooterButton = controlBinding . addBoolean ( "Shooter<seq2seq4repair_space>Cancel<seq2seq4repair_space>Action" ) ; shooterStates . setStateWhen ( "passive" , cancelShooterButton . onPress ( ) ) ; shooterStates . setStateWhen ( "ejecting" , exhaleButton . onPress ( ) ) ; shooterStates . setStateWhen ( "intaking" , inhaleButton . onPress ( ) ) ; shooterStates . transitionStateWhen ( "intaking" , "loaded" , flywheelTalon . speed . atMost ( mainTuning . getFloat ( "Shooter<seq2seq4repair_space>Flywheel<seq2seq4repair_space>Maximum<seq2seq4repair_space>Off<seq2seq4repair_space>Speed" , 10.0F ) ) . onPress ( ) ) ; shooterStates . setStateWhen ( "cocking" , prefireButton . onPress ( ) ) ; shooterStates . setStateWhen ( "firing" , fireButton . onPress ( ) . and ( flywheelTalon . speed . atLeast ( mainTuning . getFloat ( "Shooter<seq2seq4repair_space>Flywheel<seq2seq4repair_space>Minimum<seq2seq4repair_space>High<seq2seq4repair_space>Speed" , 2300.0F ) ) ) ) ; shooterStates . setStateWhen ( "passive" , startDisabled ) ; shooterStates . setStateWhen ( "passive" , startTele ) ; shooterStates . setStateWhen ( "passive" , startAuto ) ; shooterStates . setStateWhen ( "passive" , startTest ) ; PauseTimer preloadingTimer = new PauseTimer ( mainTuning . getFloat ( "Shooter<seq2seq4repair_space>Cocking<seq2seq4repair_space>Timer" , 0.12F ) ) ; <START_BUG> preloadingTimer . triggerAtEnd ( shooterStates . getStateSetEvent ( "spinup" ) ) ; <END_BUG> shooterStates . onEnterState ( "cocking" , preloadingTimer ) ; shooterStates . selectByState ( zero , mainTuning . getFloat ( "Shooter<seq2seq4repair_space>Eject<seq2seq4repair_space>Speed" , 1.0F ) , mainTuning . getFloat ( "Shooter<seq2seq4repair_space>Intake<seq2seq4repair_space>Speed" , ( - 1.0F ) ) , zero , FloatInput . always ( 1.0F ) , zero , FloatInput . always ( 1.0F ) ) . send ( FRC . talonSimpleCAN ( 7 , MOTOR_FORWARD ) . combine ( FRC . talonSimpleCAN ( 8 , MOTOR_FORWARD ) ) ) ; } private static TalonExtendedMotor makeLinkedTalons ( ) { } }

Fix:
preloadingTimer . triggerAtEnd ( shooterStates . getStateTransitionEvent ( "cocking" , "spinup" ) ) ;