Developers API

Loading dependency

You can add KGenerators as dependency directly via jar file or use Mave/Gradle

Maven

<repositories>
  <repository>
    <id>codemc-repo</id>
    <url>https://repo.codemc.org/repository/maven-public/</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>me.kryniowesegryderiusz</groupId>
    <artifactId>kgenerators-core</artifactId>
    <version>VERSION</version>
    <scope>provided</scope>
  </dependency>
</dependencies>

Gradle

circle-exclamation

Getting started with KGeneratorsAPI

All API methods are accessible from KGeneratorsAPIarrow-up-right class

The most important Interface is IGeneratorLocationarrow-up-right, which manages Generator at specific location.

Related to that is method KGeneratorsAPI#getGeneratorLocation(Location)

A few examples below

chevron-rightExample of getting generator from locationhashtag
chevron-rightExample of removing generator from locationhashtag

location - Bukkit Location variable

chevron-rightExample of checking if mining generator is possiblehashtag

This can be related for example to CustomEnchants/Minions plugins

location - Bukkit Location variable for mined block

player - Player related with this action

Events

  • PreBlockGenerationEvent - cancellable event called when generator regenegenerating function is fired, returns IGeneratorLocationarrow-up-right``

  • PostBlockGenerationEvent - called after generator regeneration, for monitoring reasons, returns IGeneratorLocationarrow-up-right``

  • ReloadEvent - called, when KGenerators is beeing reloaded.

Last updated