MineQuest-2-API

A Quick Overview

View project onGitHub

Overview

This site was created to help developers look up information and integrate MineQuest into their plugins through the use of this API. If you're looking to also integrate with our RPG and NPC plugins, you should check out their APIs and overview pages respectively.

Linking to MineQuest-2-API

You can most easily do this with Maven.

<dependency>
   <groupId>com.theminequest</groupId>
   <artifactId>MineQuest-API</artifactId>
   <version>2.0.0-SNAPSHOT</version>
</dependency>

In addition, you'll need our repository:

<repositories>
   <repository>
      <id>jci-lincom</id>
      <url>http://jci.lincomlinux.org/plugin/repository/everything/</url>
   </repository>
</repositories>

Accessing Information

All accessible information should be done through the managers provided. See the Managers class for more information on how to access these managers.

Listening to System Events

Whenever an action is triggered in MineQuest, the respective event is fired to the system event system for any plugins to process. You should see a list of these events in com.theminequest.MineQuest.API.Events, and select your system respectively. We have a wrapper that automatically fires the correct event for the correct system.

Some events are cancellable. Should you not want an event to occur, simply cancel it.

Creating Quest Events

Quest Events - that is, events that trigger during a quest, allow complete control over the quest (and if manually triggered outside a quest, complete control of the server).

A brief overview of how this works:

  • You make a class that extends QuestEvent, DelayedQuestEvent, TargetQuestEvent, or another class that extends off of one of those. It must have a default constructor (aka, no parameters in the constructor).
  • MineQuest, with its EventManager, takes that event, initializes it, and keeps track of it.
  • In addition, to have your event display an objective to the user, you may implement UserQuestEvent.

You can find the source for these events in the Javadoc.

After you have created your QuestEvent, you should register it. The EventManager class should help you register your new event with MineQuest so that it becomes functional. Give your event a name and register it and the class you've just created that implements QuestEvent! (Hint: EventManager's addEvent() method)

Accessing the Quest Parser

If you wanted to add your own touch into Quest files, there's never been a better time! You can do that with our QuestParser interface. It's quite simple to implement and register.

You should implement the QuestParser.QHandler interface.

The QuestDetails class describes the quest from start to finish, including every single minute detail. It is simply a LinkedHashMap database of String keys and Serializable objects. Simply see the Javadocs to learn on how to access the properties.

Now register it with the quest parsing system! You should go to the QuestManager, and register it, giving your parser a name (to identify it while parsing), and a new instance of the class you've just created that implements QuestParser.QHandler!