Class: Player

Player(nick)

new Player(nick)

Parameters:
Name Type Description
nick String The nickname for the player
Properties:
Name Type Description
nickname String The nickname of the player
id Number The id of the player
HP Integer The current number of health points the player has.
maxHP integer The maximum number of health points the player can have.
position BlockPosition The current BlockPosition of the player. This is the BlockPosition of the player's feet.
xSpeed Number The speed at which the player changes their block x position per tick when moving.
ySpeed Number The speed at which the player changes their block y position per tick when moving.
Source:

Methods

(static) this.positionInHitBox(entity, testPosition) → {Boolean}

This function tests to see if the given BlockPosition is within the target entity's hitbox. Takes into account sectors!
Parameters:
Name Type Description
entity Object The entity that is being tested to see if testPosition is within its hitbox
testPosition BlockPosition The BlockPosition that represents the position that is being tested to see if it is within the entity's hitbox
Source:
Returns:
True if the BlockPosition is within the target entity's hitbox. False otherwise.
Type
Boolean