TheSearch
  • TheSearch WIKI
  • How to Start
  • Searches Tutorial
  • Find Effects
  • Config.yml Tutorial
  • Commands and Permissions
  • PlaceholderAPI variables
  • API
  • Examples
    • Halloween example
    • Christmas Search example
    • Search with MythicMobs example
  • messages.yml Translations
    • Default
    • Russian (by KILLER42)
    • Ukranian (by KILLER42)
    • Spanish (by PiolaMC Network)
Powered by GitBook
On this page
  • Methods
  • Events

API

Methods

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

int total = TheSearchAPI.getTotalFoundObjects(Player player,String searchName);
int remaining = TheSearchAPI.getRemainingObjectsToFind(Player player,String searchName);
boolean isCompleted = TheSearchAPI.hasCompletedSearch(Player player,String searchName);

Events

// Event called when a player finds an object
@EventHandler
public void findObject(SearchFindEvent event){
    Player player = event.getPlayer();
    ObjectToFind object = event.getFoundObject();
    Search search = event.getSearch();
    boolean isLastBlock = event.isLast();
}
PreviousPlaceholderAPI variablesNextHalloween example

Last updated 1 year ago