Player

object Player

Types

Link copied to clipboard
object armor

Functions

Link copied to clipboard
fun asPlayerMP(): PlayerMP?
Link copied to clipboard
fun draw(x: Int, y: Int, rotate: Boolean = false, showNametag: Boolean = false, showArmor: Boolean = true, showCape: Boolean = true, showHeldItem: Boolean = true, showArrows: Boolean = true): Player

Draws the player in the GUI

Link copied to clipboard
fun facing(): String

Gets the direction the player is facing. Example: "South West"

Link copied to clipboard
fun getActivePotionEffects(): List<PotionEffect>
Link copied to clipboard
fun getAirLevel(): Int

Gets the player's air level.

Link copied to clipboard
fun getArmorPoints(): Int
Link copied to clipboard
fun getBiome(): String
Link copied to clipboard
fun getContainer(): Inventory?

Gets the container the user currently has open, i.e. a chest.

Link copied to clipboard
fun getDisplayName(): TextComponent

Gets the display name for the player, i.e. the name shown in tab list and in the player's nametag.

Link copied to clipboard
fun getHeldItem(): Item?
Link copied to clipboard
fun getHeldItemIndex(): Int
Link copied to clipboard
fun getHP(): Float
Link copied to clipboard
fun getHunger(): Int
Link copied to clipboard
fun getInventory(): Inventory?

Gets the inventory of the player, i.e. the inventory accessed by 'e'.

Link copied to clipboard
fun getLastX(): Double
Link copied to clipboard
fun getLastY(): Double
Link copied to clipboard
fun getLastZ(): Double
Link copied to clipboard
fun getLightLevel(): Int

Gets the light level at the player's current position.

Link copied to clipboard
fun getMotionX(): Double

Gets the player's x motion. This is the amount the player will move in the x direction next tick.

Link copied to clipboard
fun getMotionY(): Double

Gets the player's y motion. This is the amount the player will move in the y direction next tick.

Link copied to clipboard
fun getMotionZ(): Double

Gets the player's z motion. This is the amount the player will move in the z direction next tick.

Link copied to clipboard
fun getName(): String

Gets the player's username.

Link copied to clipboard
fun getOpenedInventory(): Inventory?
Link copied to clipboard
fun getPitch(): Float

Gets the player's camera pitch.

Link copied to clipboard
fun getPlayer(): EntityPlayerSP?

Gets Minecraft's EntityPlayerSP object representing the user

Link copied to clipboard
fun getRawYaw(): Float

Gets the player's yaw rotation without wrapping.

Link copied to clipboard
fun getRenderX(): Double
Link copied to clipboard
fun getRenderY(): Double
Link copied to clipboard
fun getRenderZ(): Double
Link copied to clipboard
fun getSaturation(): Float
Link copied to clipboard
fun getTeam(): Team?
Link copied to clipboard
fun getUUID(): String
Link copied to clipboard
fun getUUIDObj(): UUID
Link copied to clipboard
fun getX(): Double
Link copied to clipboard
fun getXPLevel(): Int
Link copied to clipboard
fun getXPProgress(): Float
Link copied to clipboard
fun getY(): Double
Link copied to clipboard
fun getYaw(): Float

Gets the player's camera yaw.

Link copied to clipboard
fun getZ(): Double
Link copied to clipboard
fun isFlying(): Boolean

Checks if player can be pushed by water.

Link copied to clipboard
fun isMoving(): Boolean
Link copied to clipboard
fun isSleeping(): Boolean
Link copied to clipboard
fun isSneaking(): Boolean
Link copied to clipboard
fun isSprinting(): Boolean
Link copied to clipboard
fun lookingAt(): Any

Gets the current object that the player is looking at, whether that be a block or an entity. Returns an air BlockType when not looking at anything.

Link copied to clipboard
fun setHeldItemIndex(index: Int)
Link copied to clipboard
fun setNametagName(textComponent: TextComponent)

Sets the name for this player shown above their head, in their name tag

Link copied to clipboard
fun setTabDisplayName(textComponent: TextComponent)

Sets the name for this player shown in tab list

Sources

Link copied to clipboard