All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.ayfri.kore.entities.Player.kt Maven / Gradle / Ivy

The newest version!
package io.github.ayfri.kore.entities

import io.github.ayfri.kore.arguments.selector.SelectorArguments
import io.github.ayfri.kore.generated.EntityTypes

class Player(name: String) : Entity() {
	init {
		selector.name = name
	}

	var name: String
		get() = selector.name ?: throw IllegalStateException("Player name is null")
		set(value) {
			selector.name = value
		}

	override val type = EntityTypes.PLAYER
}

fun player(name: String, nbtData: SelectorArguments.() -> Unit = {}) = Player(name).apply {
	selector.nbtData()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy