Update API authored by sachin gorkar's avatar sachin gorkar
...@@ -27,21 +27,29 @@ Maven ...@@ -27,21 +27,29 @@ Maven
Examples Examples
-------- --------
### 1) Spawning a MythicMob
### 1) Spawning a Mythicmob
```java ```java
Optional<MythicMob> mob = MythicBukkit.inst().getMobManager().getMythicMob("SkeletalKnight"); MythicMob mob = MythicBukkit.inst().getMobManager().getMythicMob("SkeletalKnight").orElse(null);
Location spawnLocation = player.getLocation(); Location spawnLocation = player.getLocation();
if(mob.isPresent()){ if(mob != null){
// spawns mob // spawns mob
ActiveMob knight = mob.get().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
```java
ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null);
if(mythicMob != null && mythicMob.getName().equals("SkeletalKnight")){
// do something with mob
}
```
The MythicMobs API contains numerous events and helper classes to help The MythicMobs API contains numerous events and helper classes to help
you utilize our mobs, items, and skill systems. you utilize our mobs, items, and skill systems.
... ...
......