Hitbox

abstract class Hitbox<L, R>

Inheritors

Functions

Link copied to clipboard
fun addLeftClickHandler(handler: L)

Adds a handler to this Hitbox that is called when a player left-clicks the hitbox

Link copied to clipboard
fun addRightClickHandler(handler: R)

Adds a handler to this Hitbox that is called when a player right-clicks the hitbox.

Link copied to clipboard
operator fun contains(location: Location): Boolean

Determines whether a given location is inside this Hitbox.

Link copied to clipboard
fun determineBlockFace(location: Vector3f): BlockFace?

Determines the clicked BlockFace of the hitbox based on the relative location provided by the interact handler. Returns null if the location is inside the hitbox.

Link copied to clipboard
fun register()

Adds the Hitbox to the world.

Link copied to clipboard
fun remove()

Removes the Hitbox from the world.