Skip to content

Extensions

Potato Destroyer edited this page Feb 17, 2018 · 1 revision

Extensions

Vector Operator

operator fun Vector.plus
operator fun Vector.minus
operator fun Vector.times
operator fun Vector.div
operator fun Vector.get
operator fun Vector.set

entity.velocity += (entity.velocity * 1.1).also { it[Axis3D.X] = it[Axis3D.Y] }

Location Operator

operator fun Location.plus
operator fun Location.minus
operator fun Location.times
operator fun Location.get
operator fun Location.set

entity.location.let {
	entity.teleport((it * it[Axis3D.Y]).also { it[Axis3D.Z] = 1.0 })
}

Bukkit API Extension

operator fun ChatColor.times()

entity.sendMessage(ChatColor.AQUA * "This an aqua text!")

Join ChatColor and String.

Clone this wiki locally