TargetOrSelf

class TargetOrSelf(val linkedOrigin: Origin, val abilityPlayer: TerixPlayer, val cooldownDuration: Duration, val searchDistance: Int, val lambda: suspend (LivingEntity) -> Unit) : TriggeringKeybindAbility

Takes a lambda which will be run when the ability is triggered. If no target LivingEntity can be found the target will be the ability player.

Constructors

Link copied to clipboard
fun TargetOrSelf(linkedOrigin: Origin, abilityPlayer: TerixPlayer, cooldownDuration: Duration, searchDistance: Int, lambda: suspend (LivingEntity) -> Unit)

Functions

Link copied to clipboard
open fun async(block: suspend CoroutineScope.() -> Unit): Job
Link copied to clipboard
open fun <R> completableAsync(block: suspend () -> R): CompletableFuture<R>
Link copied to clipboard
open fun <R> completableSync(block: suspend () -> R): CompletableFuture<R>
Link copied to clipboard
open fun <R> deferredAsync(block: suspend () -> R): Deferred<R>
Link copied to clipboard
open fun <R> deferredSync(block: suspend () -> R): Deferred<R>
Link copied to clipboard
open fun deleteProperty(key: String)
Link copied to clipboard
open fun getKoin(): Koin
Link copied to clipboard
open fun <T : Any> getProperty(key: String): T?
open fun <T : Any> getProperty(key: String, default: T): T
Link copied to clipboard
open suspend override fun handleTrigger()
Link copied to clipboard
open fun launch(dispatcher: CoroutineContext, block: suspend CoroutineScope.() -> Unit): Job
Link copied to clipboard
open fun registerEvents(vararg listeners: Listener)
Link copied to clipboard
open fun <T : Any> setProperty(key: String, value: T): T
Link copied to clipboard
open fun sync(block: suspend CoroutineScope.() -> Unit): Job

Properties

Link copied to clipboard
open override val abilityPlayer: TerixPlayer
Link copied to clipboard
Link copied to clipboard
open override val cooldownDuration: Duration

The duration of the cooldown.

Link copied to clipboard
val lambda: suspend (LivingEntity) -> Unit

The lambda to run when the ability is triggered.

Link copied to clipboard
open override val linkedOrigin: Origin

The origin, which this ability is linked to.

Link copied to clipboard
open val logger: MinixLogger
Link copied to clipboard
open val name: String
Link copied to clipboard
override val plugin: Terix
Link copied to clipboard

The distance to search for a target.