Update API authored by Lxlp's avatar Lxlp
JavaDocs JavaDocs
-------- --------
JavaDocs for Mythic API can be found here: JavaDocs for Mythic API can be found here:
1. <https://www.mythiccraft.io/javadocs/mythic/> 1. <https://www.mythiccraft.io/javadocs/mythic/>
------------------------- -------------------------
## Repositories ## Repositories
#### Maven #### Maven
```xml ```xml
<repository> <repository>
<id>nexus</id> <id>nexus</id>
<name>Lumine Releases</name> <name>Lumine Releases</name>
<url>https://mvn.lumine.io/repository/maven-public/</url> <url>https://mvn.lumine.io/repository/maven-public/</url>
</repository> </repository>
``` ```
#### Gradle (Groovy) #### Gradle (Groovy)
```groovy ```groovy
repositories { repositories {
// ... // ...
mavenCentral() mavenCentral()
maven { url 'https://mvn.lumine.io/repository/maven-public/' } maven { url 'https://mvn.lumine.io/repository/maven-public/' }
} }
``` ```
#### Gradle (Kotlin) #### Gradle (Kotlin)
```kotlin ```kotlin
repositories { repositories {
// ... // ...
mavenCentral() mavenCentral()
maven(url = "https://mvn.lumine.io/repository/maven-public/") maven(url = "https://mvn.lumine.io/repository/maven-public/")
} }
``` ```
## Dependencies ## Dependencies
#### Maven #### Maven
```xml ```xml
<dependency> <dependency>
<groupId>io.lumine</groupId> <groupId>io.lumine</groupId>
<artifactId>Mythic-Dist</artifactId> <artifactId>Mythic-Dist</artifactId>
<version>5.6.1</version> <version>5.6.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
``` ```
#### Gradle (Groovy) #### Gradle (Groovy)
```groovy ```groovy
dependencies { dependencies {
//... //...
compileOnly 'io.lumine:Mythic-Dist:5.6.1' compileOnly 'io.lumine:Mythic-Dist:5.6.1'
} }
``` ```
#### Gradle (Kotlin) #### Gradle (Kotlin)
```kotlin ```kotlin
dependencies { dependencies {
// ... // ...
compileOnly("io.lumine:Mythic-Dist:5.6.1") compileOnly("io.lumine:Mythic-Dist:5.6.1")
} }
``` ```
-------------------------- --------------------------
Examples # Placeholders
-------- You can find the Placeholders API [here](/API/Placeholders)
The MythicMobs API contains numerous events and helper classes to help
you utilize our mobs, items, and skill systems. ---
Some examples to help you get started can be found here: Examples
--------
1. [MythicMobs API Examples Repo](https://github.com/xikage/MythicMobs-API-Examples) The MythicMobs API contains numerous events and helper classes to help
you utilize our mobs, items, and skill systems.
### Spawning a MythicMob
Some examples to help you get started can be found here:
```java
MythicMob mob = MythicBukkit.inst().getMobManager().getMythicMob("SkeletalKnight").orElse(null); 1. [MythicMobs API Examples Repo](https://github.com/xikage/MythicMobs-API-Examples)
Location spawnLocation = player.getLocation();
if(mob != null){ ### Spawning a MythicMob
// spawns mob
ActiveMob knight = mob.spawn(BukkitAdapter.adapt(spawnLocation),1); ```java
MythicMob mob = MythicBukkit.inst().getMobManager().getMythicMob("SkeletalKnight").orElse(null);
// get mob as bukkit entity Location spawnLocation = player.getLocation();
Entity entity = knight.getEntity().getBukkitEntity(); if(mob != null){
} // spawns mob
``` ActiveMob knight = mob.spawn(BukkitAdapter.adapt(spawnLocation),1);
### Check if a Bukkit Entity is a MythicMob // get mob as bukkit entity
```java Entity entity = knight.getEntity().getBukkitEntity();
Entity bukkitEntity = ...; }
boolean isMythicMob = MythicBukkit.inst().getMobManager().isMythicMob(bukkitEntity); ```
if(isMythicMob){
// ... ### Check if a Bukkit Entity is a MythicMob
} ```java
``` Entity bukkitEntity = ...;
boolean isMythicMob = MythicBukkit.inst().getMobManager().isMythicMob(bukkitEntity);
### Get ActiveMob instance from Bukkit Entity if(isMythicMob){
```java // ...
Entity bukkitEntity = ...; }
Optional<ActiveMob> optActiveMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()); ```
optActiveMob.ifPresent(activeMob -> {
//... ### Get ActiveMob instance from Bukkit Entity
}).orElse(() -> /* ... */); ```java
``` Entity bukkitEntity = ...;
Optional<ActiveMob> optActiveMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId());
### Get a collection of ActiveMobs using a predicate optActiveMob.ifPresent(activeMob -> {
```java //...
Collection<ActiveMob> activeMobs = MythicBukkit.inst().getMobManager().getActiveMobs(am -> am.getMobType().equals("SkeletalKnight")); }).orElse(() -> /* ... */);
``` ```
<!--
Events ### Get a collection of ActiveMobs using a predicate
------ ```java
Collection<ActiveMob> activeMobs = MythicBukkit.inst().getMobManager().getActiveMobs(am -> am.getMobType().equals("SkeletalKnight"));
| | | ```
|------------------------------------------------------------------|------------------------------------------------| <!--
| Event | Description | Events
| [MythicReloadedEvent](/api/events/MythicReloadedEvent) | Called when the plugin is reloaded | ------
| [MythicMobSpawnEvent](/api/events/MythicMobSpawnEvent) | Called when a MythicMob spawns |
| [MythicMobDeathEvent](/api/events/MythicMobDeathEvent) | Called when a MythicMob dies | | | |
| [MythicMobDespawnEvent](/api/events/MythicMobDespawnEvent) | Called when a MythicMob despawns without dying | |------------------------------------------------------------------|------------------------------------------------|
| [MythicMobLootDropEvent](/api/events/MythicMobLootDropEvent) | Called right before a loot table is generated | | Event | Description |
| [MythicConditionLoadEvent](/api/events/MythicConditionLoadEvent) | Called when a custom condition is loaded | | [MythicReloadedEvent](/api/events/MythicReloadedEvent) | Called when the plugin is reloaded |
| [MythicDropLoadEvent](/api/events/MythicDropLoadEvent) | Called when a custom drop is loaded | | [MythicMobSpawnEvent](/api/events/MythicMobSpawnEvent) | Called when a MythicMob spawns |
| [MythicMechanicLoadEvent](/api/events/MythicMechanicLoadEvent) | Called when a custom mechanic is loaded | | [MythicMobDeathEvent](/api/events/MythicMobDeathEvent) | Called when a MythicMob dies |
| [MythicTargeterLoadEvent](/api/events/MythicTargeterLoadEvent) | Called when a custom targeter is loaded | | [MythicMobDespawnEvent](/api/events/MythicMobDespawnEvent) | Called when a MythicMob despawns without dying |
| [MythicMobLootDropEvent](/api/events/MythicMobLootDropEvent) | Called right before a loot table is generated |
| [MythicConditionLoadEvent](/api/events/MythicConditionLoadEvent) | Called when a custom condition is loaded |
| [MythicDropLoadEvent](/api/events/MythicDropLoadEvent) | Called when a custom drop is loaded |
| [MythicMechanicLoadEvent](/api/events/MythicMechanicLoadEvent) | Called when a custom mechanic is loaded |
| [MythicTargeterLoadEvent](/api/events/MythicTargeterLoadEvent) | Called when a custom targeter is loaded |
--> -->
\ No newline at end of file