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 146
    • Issues 146
    • 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
Show 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: ...@@ -8,7 +8,7 @@ JavaDocs for Mythic API can be found here:
------------------------- -------------------------
## Repositories ## Repositories
### Maven #### Maven
```xml ```xml
<repository> <repository>
<id>nexus</id> <id>nexus</id>
...@@ -16,8 +16,7 @@ JavaDocs for Mythic API can be found here: ...@@ -16,8 +16,7 @@ JavaDocs for Mythic API can be found here:
<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 {
// ... // ...
...@@ -25,9 +24,8 @@ repositories { ...@@ -25,9 +24,8 @@ repositories {
maven { url 'https://mvn.lumine.io/repository/maven-public/' } maven { url 'https://mvn.lumine.io/repository/maven-public/' }
} }
``` ```
#### Gradle (Kotlin)
### Gradle (Kotlin) ```kotlin
```groovy
repositories { repositories {
// ... // ...
mavenCentral() mavenCentral()
...@@ -36,11 +34,7 @@ repositories { ...@@ -36,11 +34,7 @@ repositories {
``` ```
## Dependencies ## Dependencies
#### Maven
#### Release Version is 5.6.1
#### Dev Builds Version is 5.6.2-SNAPSHOT
### Maven
```xml ```xml
<dependency> <dependency>
<groupId>io.lumine</groupId> <groupId>io.lumine</groupId>
...@@ -49,17 +43,15 @@ repositories { ...@@ -49,17 +43,15 @@ repositories {
<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
```groovy
dependencies { dependencies {
// ... // ...
compileOnly("io.lumine:Mythic-Dist:5.6.1") compileOnly("io.lumine:Mythic-Dist:5.6.1")
...@@ -69,58 +61,46 @@ dependencies { ...@@ -69,58 +61,46 @@ dependencies {
Examples Examples
-------- --------
### 1) Spawning a MythicMob 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)
### Spawning a MythicMob
```java ```java
MythicMob mob = MythicBukkit.inst().getMobManager().getMythicMob("SkeletalKnight").orElse(null); MythicMob mob = MythicBukkit.inst().getMobManager().getMythicMob("SkeletalKnight").orElse(null);
Location spawnLocation = player.getLocation(); Location spawnLocation = player.getLocation();
if(mob != null){ if(mob != null){
// spawns mob // spawns mob
ActiveMob knight = mob.spawn(BukkitAdapter.adapt(spawnLocation),1); ActiveMob knight = mob.spawn(BukkitAdapter.adapt(spawnLocation),1);
// get mob as bukkit entity // get mob as bukkit entity
Entity entity = knight.getEntity().getBukkitEntity(); Entity entity = knight.getEntity().getBukkitEntity();
} }
``` ```
### 2) Check BukkitEntity for MythicMob ### Check if a bukkit entity is a MythicMob
```java
ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null);
if(mythicMob != null && mythicMob.getMobType().equals("SkeletalKnight")){
// do something with mob
}
```
```java ```java
ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null); Entity bukkitEntity = ...;
if(mythicMob != null && mythicMob.getType().getInternalName().equals("SkeletalKnight")){ boolean isMythicMob = MythicBukkit.inst().getMobManager().isMythicMob(bukkitEntity);
// do something with mob if(isMythicMob){
} // ...
}
``` ```
### 3) Get a collection of ActiveMob with a filter/predicate ### Get a collection of ActiveMobs using a predicate
```java ```java
Collection<ActiveMob> activeMobs = MythicBukkit.inst().getMobManager().getActiveMobs(am -> am.getMobType().equals("SkeletalKnight")); 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:
1. [MythicMobs API Examples Repo](https://github.com/xikage/MythicMobs-API-Examples)
Events Events
------ ------
| | | | | |
|------------------------------------------------------------------|------------------------------------------------| |------------------------------------------------------------------|------------------------------------------------|
| &lt; 100% 30% &gt; | |
| Event | Description | | Event | Description |
| [MythicReloadedEvent](/api/events/MythicReloadedEvent) | Called when the plugin is reloaded | | [MythicReloadedEvent](/api/events/MythicReloadedEvent) | Called when the plugin is reloaded |
| [MythicMobSpawnEvent](/api/events/MythicMobSpawnEvent) | Called when a MythicMob spawns | | [MythicMobSpawnEvent](/api/events/MythicMobSpawnEvent) | Called when a MythicMob spawns |
...@@ -131,3 +111,4 @@ Events ...@@ -131,3 +111,4 @@ Events
| [MythicDropLoadEvent](/api/events/MythicDropLoadEvent) | Called when a custom drop is loaded | | [MythicDropLoadEvent](/api/events/MythicDropLoadEvent) | Called when a custom drop is loaded |
| [MythicMechanicLoadEvent](/api/events/MythicMechanicLoadEvent) | Called when a custom mechanic is loaded | | [MythicMechanicLoadEvent](/api/events/MythicMechanicLoadEvent) | Called when a custom mechanic is loaded |
| [MythicTargeterLoadEvent](/api/events/MythicTargeterLoadEvent) | Called when a custom targeter is loaded | | [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