use of com.bergerkiller.generated.net.minecraft.world.entity.EntityInsentientHandle in project BKCommonLib by bergerhealer.
the class ExtendedEntity method getLeashHolder.
/**
* Gets the Entity that is holding this Entity by a leash. If this Entity
* does not support leashing, or the Entity is not on a leash, null is
* returned instead.
*
* @return Leash holder
*/
public org.bukkit.entity.Entity getLeashHolder() {
if (handle.isInstanceOf(EntityInsentientHandle.T)) {
EntityInsentientHandle insHandle = EntityInsentientHandle.createHandle(handle.getRaw());
EntityHandle holder = insHandle.getLeashHolder();
if (holder != null) {
return holder.getBukkitEntity();
}
}
return null;
}
Aggregations