JavaDocs
JavaDocs for MythicMobs API can be found here:
Repositories
Maven
<repository>
<id>nexus</id>
<name>Lumine Releases</name>
<url>https://mvn.lumine.io/repository/maven-public/</url>
</repository>
Gradle (Groovy)
repositories {
// ...
mavenCentral()
maven { url 'https://mvn.lumine.io/repository/maven-public/' }
}
Gradle (Kotlin)
repositories {
// ...
mavenCentral()
maven(url = "https://mvn.lumine.io/repository/maven-public/")
}
Dependencies
Release Version is 5.3.5
Dev Builds Version is 5.4.0-SNAPSHOT
Maven
<dependency>
<groupId>io.lumine</groupId>
<artifactId>Mythic-Dist</artifactId>
<version>5.3.5</version>
<scope>provided</scope>
</dependency>
Gradle (Groovy)
dependencies {
//...
compileOnly 'io.lumine:Mythic-Dist:5.3.5'
}
Gradle (Kotlin)
dependencies {
// ...
compileOnly("io.lumine:Mythic-Dist:5.3.5")
}
Examples
1) Spawning a MythicMob
MythicMob mob = MythicBukkit.inst().getMobManager().getMythicMob("SkeletalKnight").orElse(null);
Location spawnLocation = player.getLocation();
if(mob != null){
// spawns mob
ActiveMob knight = mob.spawn(BukkitAdapter.adapt(spawnLocation),1);
// get mob as bukkit entity
Entity entity = knight.getEntity().getBukkitEntity();
}
2) Check BukkitEntity for MythicMob
ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null);
if(mythicMob != null && mythicMob.getMobType().equals("SkeletalKnight")){
// do something with mob
}
ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null);
if(mythicMob != null && mythicMob.getType().getInternalName().equals("SkeletalKnight")){
// do something with mob
}
3) Get a collection of ActiveMob with a filter/predicate
Collection<ActiveMob> activeMobs = MythicBukkit.inst().getMobManager().getActiveMobs(am -> am.getMobType().equals("SkeletalKnight"));
//or use the Streams api
Collection<ActiveMob> activeMobs = MythicBukkit.inst().getMobManager().getActiveMobs();
Collection<ActiveMob> filteredMobs = activeMobs.stream().filter(activeMob -> activeMob.getMobType().equals("SkeletalKnight")).toList();
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:
Events
< 100% 30% > | |
Event | Description |
MythicReloadedEvent | Called when the plugin is reloaded |
MythicMobSpawnEvent | Called when a MythicMob spawns |
MythicMobDeathEvent | Called when a MythicMob dies |
MythicMobDespawnEvent | Called when a MythicMob despawns without dying |
MythicMobLootDropEvent | Called right before a loot table is generated |
MythicConditionLoadEvent | Called when a custom condition is loaded |
MythicDropLoadEvent | Called when a custom drop is loaded |
MythicMechanicLoadEvent | Called when a custom mechanic is loaded |
MythicTargeterLoadEvent | Called when a custom targeter is loaded |