Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 143
    • Issues 143
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Wiki
  • API

API · Changes

Page history
Updated api examples and formatting authored Mar 16, 2024 by Phillip's avatar Phillip
Hide whitespace changes
Inline Side-by-side
Showing with 35 additions and 54 deletions
+35 -54
  • API.md API.md +35 -54
  • No files found.
API.md
View page @ d86cbdde
......@@ -8,7 +8,7 @@ JavaDocs for Mythic API can be found here:
-------------------------
## Repositories
### Maven
#### Maven
```xml
<repository>
<id>nexus</id>
......@@ -16,8 +16,7 @@ JavaDocs for Mythic API can be found here:
<url>https://mvn.lumine.io/repository/maven-public/</url>
</repository>
```
### Gradle (Groovy)
#### Gradle (Groovy)
```groovy
repositories {
// ...
......@@ -25,9 +24,8 @@ repositories {
maven { url 'https://mvn.lumine.io/repository/maven-public/' }
}
```
### Gradle (Kotlin)
```groovy
#### Gradle (Kotlin)
```kotlin
repositories {
// ...
mavenCentral()
......@@ -36,11 +34,7 @@ repositories {
```
## Dependencies
#### Release Version is 5.6.1
#### Dev Builds Version is 5.6.2-SNAPSHOT
### Maven
#### Maven
```xml
<dependency>
<groupId>io.lumine</groupId>
......@@ -49,17 +43,15 @@ repositories {
<scope>provided</scope>
</dependency>
```
### Gradle (Groovy)
#### Gradle (Groovy)
```groovy
dependencies {
//...
compileOnly 'io.lumine:Mythic-Dist:5.6.1'
}
```
### Gradle (Kotlin)
```groovy
#### Gradle (Kotlin)
```kotlin
dependencies {
// ...
compileOnly("io.lumine:Mythic-Dist:5.6.1")
......@@ -69,58 +61,46 @@ dependencies {
Examples
--------
### 1) Spawning a MythicMob
The MythicMobs API contains numerous events and helper classes to help
you utilize our mobs, items, and skill systems.
```java
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();
}
```
Some examples to help you get started can be found here:
1. [MythicMobs API Examples Repo](https://github.com/xikage/MythicMobs-API-Examples)
### 2) Check BukkitEntity for MythicMob
### Spawning a MythicMob
```java
ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null);
if(mythicMob != null && mythicMob.getMobType().equals("SkeletalKnight")){
// do something with mob
}
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();
}
```
### Check if a bukkit entity is a MythicMob
```java
ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null);
if(mythicMob != null && mythicMob.getType().getInternalName().equals("SkeletalKnight")){
// do something with mob
}
Entity bukkitEntity = ...;
boolean isMythicMob = MythicBukkit.inst().getMobManager().isMythicMob(bukkitEntity);
if(isMythicMob){
// ...
}
```
### 3) Get a collection of ActiveMob with a filter/predicate
### Get a collection of ActiveMobs using a predicate
```java
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();
Collection<ActiveMob> activeMobs = MythicBukkit.inst().getMobManager().getActiveMobs(am -> am.getMobType().equals("SkeletalKnight"));
```
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:
1. [MythicMobs API Examples Repo](https://github.com/xikage/MythicMobs-API-Examples)
<!--
Events
------
| | |
|------------------------------------------------------------------|------------------------------------------------|
| &lt; 100% 30% &gt; | |
| Event | Description |
| [MythicReloadedEvent](/api/events/MythicReloadedEvent) | Called when the plugin is reloaded |
| [MythicMobSpawnEvent](/api/events/MythicMobSpawnEvent) | Called when a MythicMob spawns |
......@@ -130,4 +110,5 @@ Events
| [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
| [MythicTargeterLoadEvent](/api/events/MythicTargeterLoadEvent) | Called when a custom targeter is loaded |
-->
\ No newline at end of file
Clone repository
Home
Changelogs
Premium Features
Commands and Permissions
FAQ / Common Issues
Mythic Add-ons
Compatible Plugins
API Information
Packs
  • Pins
Mobs
  • Mob Options
    • Display Options
  • Mob Levels
  • Mob Factions
  • Power Scaling
  • Damage Modifiers
  • Equipment
  • BossBar
  • Custom AI
  • Custom Kill Messages
  • Threat Tables
  • Immunity Tables
  • Templates
  • Vanilla Overrides
  • Extra: Disguises
  • Extra: ModelEngine
Skills
  • Mechanics
  • Targeters
    • Filters
  • Triggers
  • Conditions
    • In-line conditions
  • Metaskills
  • Placeholders
  • Variables
Items
  • Options
  • Attributes
  • Enchantments
  • Potions
  • Banner Layers
  • Firework
Drops & DropTables
  • Drops
  • DropTables
  • FancyDrops
Spawning
  • Spawners
  • Random Spawns
Stats
  • Custom Stat Options
  • Modifiers
  • Built in Stats
Technical
  • Math
  • Operations
    • Attribute Operations
    • Stats Modifiers
  • Particles Types
  • Audience
Examples
Useful Tips