Class ClueScrollsAPI
java.lang.Object
com.electro2560.dev.cluescrolls.api.ClueScrollsAPI
- Since:
- 2.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringgetCrystalTier(org.bukkit.inventory.ItemStack item) Get the tier of a crystal itemstatic ClueScrollsAPIAccess the ClueScrollsAPIabstract org.bukkit.inventory.ItemStackgetRandomScroll(String mystery, org.bukkit.entity.Player player) Get a random tier cluescroll Will obey bind optionabstract org.bukkit.inventory.ItemStackGenerate a cluescroll of a random tier Will obey bind optionabstract StringgetScrollTier(org.bukkit.inventory.ItemStack item) Get the tier of a scroll itemgetTiers()Get a list of all tiersabstract StringGet ClueScrolls versionstatic booleanCheck if the ClueScrollsAPI implementation is availableabstract booleanisCrystal(org.bukkit.inventory.ItemStack item) Check if item is a crystalabstract booleanisScroll(org.bukkit.inventory.ItemStack item) Check if item is a scrollabstract CustomClueregisterCustomClue(org.bukkit.plugin.Plugin plugin, String clueName, ClueConfigData... clueConfigData) To create a custom clue, you must pass your plugin, the name of the clue and an array of ClueConfigData.
-
Constructor Details
-
ClueScrollsAPI
public ClueScrollsAPI()
-
-
Method Details
-
hasImplementation
public static boolean hasImplementation()Check if the ClueScrollsAPI implementation is available- Returns:
- true if ClueScrollsAPI available or false if not available
-
getInstance
Access the ClueScrollsAPI- Returns:
- ClueScrollsAPI instance
-
getVersion
Get ClueScrolls version- Returns:
- version
-
getTiers
Get a list of all tiers- Returns:
- List of all tiers
-
getRandomScroll
public abstract org.bukkit.inventory.ItemStack getRandomScroll(String mystery, org.bukkit.entity.Player player) Get a random tier cluescroll Will obey bind option- Parameters:
player- The player who will be given this scroll- Returns:
- A cluescroll
- Since:
- 2.1.8
-
getScroll
public abstract org.bukkit.inventory.ItemStack getScroll(String type, org.bukkit.entity.Player player) Generate a cluescroll of a random tier Will obey bind option- Parameters:
type- tier typeplayer- The player who will be given this scroll- Returns:
- A cluescroll
- Since:
- 2.1.8
-
isScroll
public abstract boolean isScroll(org.bukkit.inventory.ItemStack item) Check if item is a scroll- Parameters:
item- An item- Returns:
- True if this item is a scroll
- Since:
- 4.9.0
-
isCrystal
public abstract boolean isCrystal(org.bukkit.inventory.ItemStack item) Check if item is a crystal- Parameters:
item- An item- Returns:
- True if this item is a crystal
- Since:
- 4.9.0
-
getScrollTier
Get the tier of a scroll item- Parameters:
item- A scroll item- Returns:
- The name of the tier or null if not a scroll item
- Since:
- 4.9.0
-
getCrystalTier
Get the tier of a crystal item- Parameters:
item- A scroll item- Returns:
- The name of the tier or null if not a crystal item
- Since:
- 4.9.0
-
registerCustomClue
public abstract CustomClue registerCustomClue(org.bukkit.plugin.Plugin plugin, String clueName, ClueConfigData... clueConfigData) To create a custom clue, you must pass your plugin, the name of the clue and an array of ClueConfigData. The name of your custom clue will be yourPlugin_clueName TheClueConfigDatarepresents the different types of data you may want a user to be able to specify in their config under the data section of the clue. To call to update any clues for a player, callCustomClue.handle(Player, ClueDataPair...)passing in the name of the player to update and an array of ClueDataPairs.ClueDataPairis similar toClueConfigData. You create ClueDataPairs to specify the details of what action the user has completed that you'd like to update clues for. TheClueDataPair.keyis the name of the data in the config for the clue, and is also the key you specified when setting up the ClueConfigData for this custom clue. If there is data you wish to ignore entirely, pass a ClueDataPair with it'sClueDataPair.valuenull.- Parameters:
plugin-clueName-clueConfigData-
-