setState

Sets the state of this instance to the given state.

When a state is switched, all event handlers of the previous state will be unregistered for the given instance world and will become unresponsive to game events. Tge new state will take over and receive new game events.

If the previous state was a VitalCountdownTask or VitalRepeatableTask, their respective VitalCountdownTask.stop and VitalRepeatableTask.stop functions are called. Upon previous state unregistration, the VitalMinigameInstanceState.onDisable functions is called, the new state's VitalMinigameInstanceState.onEnable function is called.