... | @@ -82,7 +82,7 @@ if(mob != null){ |
... | @@ -82,7 +82,7 @@ if(mob != null){ |
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
### Check if a bukkit entity is a MythicMob
|
|
### Check if a Bukkit Entity is a MythicMob
|
|
```java
|
|
```java
|
|
Entity bukkitEntity = ...;
|
|
Entity bukkitEntity = ...;
|
|
boolean isMythicMob = MythicBukkit.inst().getMobManager().isMythicMob(bukkitEntity);
|
|
boolean isMythicMob = MythicBukkit.inst().getMobManager().isMythicMob(bukkitEntity);
|
... | @@ -91,6 +91,15 @@ if(isMythicMob){ |
... | @@ -91,6 +91,15 @@ if(isMythicMob){ |
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Get ActiveMob instance from Bukkit Entity
|
|
|
|
```java
|
|
|
|
Entity bukkitEntity = ...;
|
|
|
|
Optional<ActiveMob> optActiveMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId());
|
|
|
|
optActiveMob.ifPresent(activeMob -> {
|
|
|
|
//...
|
|
|
|
}).orElse(() -> /* ... */);
|
|
|
|
```
|
|
|
|
|
|
### Get a collection of ActiveMobs using a 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"));
|
... | | ... | |