💬
Conversation Wiki
  • 💬Conversation
  • 📖Basics
    • Folder
    • File
    • Step Architecture
  • 🪜Steps
    • ConsoleCommandStep
    • ForcePlayerCommand
    • ActionBarStep
    • ChatClickChoiceTextStep
    • ClickTextStep
    • DelayTextStep
    • MovementChoiceTextStep
    • StartConversationStep
    • PlayerPlaySound
  • 📕Conditions
    • PAPICondition
    • PermissionCondition
  • 🪝Triggers
    • BlockTrigger
    • NpcTrigger
  • ⚙️Options
    • CancelCommandOption
    • EndStepOption
    • HideChatOption
    • MoveAwayToEndConversationOption
    • NoDamageOption
    • PositionLockOption
    • RotationLockOption
    • ShiftToEndConversationOption
  • 🛠️API
    • Implemented in your project
    • Simple case with the API
    • Adding a custom module with the API
Powered by GitBook
On this page
  1. API

Simple case with the API

Conversation manipulation

Start a conversation:

// Get the manager
ConversationManager conversationManager = ConversationManager.getInstance();

// Get the conversation
Conversation conversation = conversationManager.getConversation("conversationId");

// Start a conversation
ActiveConversation activeConv = conversation.startNewConversation(player);

Check if player is currently conversing

// Get the manager
ConversationManager conversationManager = ConversationManager.getInstance();

// Check if player in conversation
if (conversationManager.inConversation(player)) {
    // Do something
}

Bukkit Events

ConversationStartEvent // Call when a player starts a conversation

ConversationUpdateStatusEvent // Call when a player change of step in a conversation

ConversationEndEvent // Call when a player stops being in conversation

/**
 * You should use this event to register your own interpreters for steps, options, triggers, and conditions
 * Because when the plugin reloads all the interpreter is reregistered!
 */
ConversationInterpretorLoadEvent

Get information

In some cases, you will need to get information about the configuration. For example when you need to send an instruction message to the player. Example "Sneak to end the conversation". In the config, you have an option to specify if the message will be sent

PreviousImplemented in your projectNextAdding a custom module with the API

Last updated 2 years ago

🛠️