Skip to main content
The VCT API exposes a single main event VCTEvent, which is triggered whenever a timer-related action occurs. This event provides all the information necessary to react appropriately in your plugin.

The event itself

import voiidstudios.vct.api.VCTEvent;

// Event called when a timer action is performed
@EventHandler
public void onVCTEvent(VCTEvent event) {

  Timer timer = event.getTimer(); // Returns null if the timer no longer exists
  CommandSender sender = event.getSender(); // It can be a player, the console, or null if it comes from another source, such as a plugin
  Player player = event.getPlayer(); // Return null if not a player
  String timerId = event.getTimerId();
  String timeInitial = event.getInitialTime();
  String timeLeft = event.getTimeLeft();
  String modifier = event.getModifier(); // Returns null if the event is not MODIFY
  String modification = event.getModification(); // Returns null if the event is not MODIFY
  
}
There are plugins such as Conditional Events (CE) that support API listening, and you can use them to create great things!

Information available in VCTEvent

timer
Timer
Returns the timer instance (may be null if the timer no longer exists)
sender
CommandSender
Source that performed the action. This can be a player, the console, or null if it comes from another source (such as a plugin)
player
Player
Player who performed the action, or null if it was not a player
timerId
String
The unique identifier of the timer
timeInitial
String
Initial time set on the timer in HH:MM:SS format
timeLeft
String
Current remaining timer time in HH:MM:SS format
modifier
String
The modifier used via /vct modify or the API. Returns null if the event is not MODIFY.
modification
String
The modification used via /vct modify or the API. Returns null if the event is not MODIFY.

Available Events

MODIFY

Triggered when a timer is modified

Not sure how to begin?

Examples

Check out the examples using API events by clicking this card!
I