Class BlockingEvent
java.lang.Object
net.storm.sdk.script.blocking_events.BlockingEvent
- Direct Known Subclasses:
DeathEvent,LoginEvent,ResizableEvent,WelcomeScreenEvent
Abstract base class for blocking events in the Storm SDK.
A blocking event represents a condition that, when active, takes priority over normal script execution. Examples include login screens, welcome screens, death events, and other situations that require immediate handling.
Implementations must define when the event is active via validate() and
what actions to take via loop().
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BlockingEvent
public BlockingEvent()
-
-
Method Details
-
validate
public abstract boolean validate()Validates whether this blocking event should be active and processed.This method is called to determine if the current game state matches the conditions that this blocking event handles. If it returns true, the
loop()method will be invoked.- Returns:
trueif this blocking event should be processed,falseotherwise
-
loop
public abstract int loop()Executes the main logic of this blocking event.This method is called when
validate()returns true. It should perform the necessary actions to handle the blocking condition.- Returns:
- the sleep duration in milliseconds before the next iteration, or a negative value to indicate the event has completed
-