For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Methods and Events

Methods

The main class for the API is InteractionsAPI. You can use this class whenever you want in your plugin.

// Returns the conversation the player is currently in
PlayerConversation c = InteractionsAPI.getPlayerConversation(Player player)
// Method to start a conversation from its file name (without .yml)
boolean startConversation = InteractionsAPI.startConversation(Player player,String conversationName)
// Ends the current conversation the player is currently in
InterationsAPI.endConversation(Player player, ConversationEndReason reason)

Events

//Event called when a player is about to start a conversation. You can cancel
//cancel the event if you need to.
@EventHandler
public void conversationStart(ConversationStartEvent event){
   Player player = event.getPlayer();
   PlayerConversation c = event.getPlayerConversation();
}
//Event called when a player has finished a conversation.
@EventHandler
public void conversationEnd(ConversationEndEvent event){
   Player player = event.getPlayer();
   PlayerConversation c = event.getPlayerConversation();
}

Last updated

Was this helpful?