cPlayer


Index:
Articles
Classes
Hooks

Quick navigation:
BannerPattern
BossBarColor
BossBarDivisionType
cArrowEntity
cBeaconEntity
cBedEntity
cBlockArea
cBlockEntity
cBlockEntityWithItems
cBlockInfo
cBoat
cBoundingBox
cBrewingstandEntity
cChatColor
cChestEntity
cChunkDesc
cClientHandle
cColor
cCommandBlockEntity
cCompositeChat
cCraftingGrid
cCraftingRecipe
cCryptoHash
cCuboid
cDispenserEntity
cDropperEntity
cDropSpenserEntity
cEnchantments
cEnderCrystal
cEntity
cEntityEffect
cExpBottleEntity
cExpOrb
cFallingBlock
cFile
cFireChargeEntity
cFireworkEntity
cFloater
cFlowerPotEntity
cFurnaceEntity
cGhastFireballEntity
cHangingEntity
cHopperEntity
cIniFile
cInventory
cItem
cItemFrame
cItemGrid
cItems
cJson
cJukeboxEntity
cLeashKnot
cLineBlockTracer
cLuaWindow
cMap
cMapManager
cMobHeadEntity
cMobSpawnerEntity
cMojangAPI
cMonster
cNetwork
cNoteEntity
cObjective
cPainting
cPawn
cPickup
cPlayer
cPlugin
cPluginLua
cPluginManager
cProjectileEntity
cRankManager
cRoot
cScoreboard
cServer
cServerHandle
cSignEntity
cSplashPotionEntity
cStringCompression
cTCPLink
cTeam
cThrownEggEntity
cThrownEnderPearlEntity
cThrownSnowballEntity
cTNTEntity
cUDPEndpoint
cUrlClient
cUrlParser
CustomStatistic
cUUID
cWebAdmin
cWindow
cWitherSkullEntity
cWorld
EffectID
HTTPFormData
HTTPRequest
HTTPTemplateRequest
ItemCategory
lxp
SmokeDirection
sqlite3
StatisticsManager
TakeDamageInfo
tolua
Vector3d
Vector3f
Vector3i
Globals

Contents


cPlayer class

This class describes a player in the server. cPlayer inherits all functions and members of cPawn. It handles all the aspects of the gameplay, such as hunger, sprinting, inventory etc.


Inheritance

This class inherits from the following parent classes:


Constants

NameValueNotes
MAX_FOOD_LEVEL The maximum food level value. When the food level is at this value, the player cannot eat.
MAX_HEALTH The maximum health value

Constants inherited from cEntity

NameValueNotes
INVALID_ID 0 Special value of an entity ID, indicating a failure. Used primarily in functions that create entities when the entity cannot be created.

Functions

NameParametersReturn valueNotes
AddFoodExhaustion
Exhaustionnumber
Adds the specified number to the food exhaustion. Only positive numbers expected.
CalcLevelFromXp
XPAmountnumber
number
(STATIC) Returns the level which is reached with the specified amount of XP. Inverse of XpForLevel().
CanFly
boolean
Returns if the player is able to fly.
CanMobsTarget
boolean
Returns if the player can be targeted by mobs.
CloseWindow
CanRefuseboolean
Closes the currently open UI window. If CanRefuse is true (default), the window may refuse the closing.
CloseWindowIfID
WindowIDnumber
CanRefuseboolean
Closes the currently open UI window if its ID matches the given ID. If CanRefuse is true (default), the window may refuse the closing.
DeltaExperience
DeltaXPnumber
number
Adds or removes XP from the current XP amount. Won't allow XP to go negative. Returns the new experience, -1 on error (XP overflow).
Feed
AddFoodnumber
AddSaturationnumber
boolean
Tries to add the specified amounts to food level and food saturation level (only positive amounts expected). Returns true if player was hungry and the food was consumed, false if too satiated.
ForceSetSpeed
DirectionVector3d
Forces the player to move to the given direction.
Freeze
LocationVector3d
Teleports the player to "Location" and prevents them from moving, locking them in place until unfreeze() is called
GetClientHandle
cClientHandle
Returns the client handle representing the player's connection. May be nil (AI players).
GetColor
string
Returns the full color code to be used for this player's messages (based on their rank). Prefix player messages with this code.
GetCurrentXp
number
Returns the current amount of XP
GetCustomName
string
Returns the custom name of this player. If the player hasn't a custom name, it will return an empty string.
GetDraggingItem
cItem
Returns the item the player is dragging in a UI window.
GetEffectiveGameMode
GameModeeGameMode
(OBSOLETE) Returns the current resolved game mode of the player. If the player is set to inherit the world's gamemode, returns that instead. See also GetGameMode() and IsGameModeXXX() functions. Note that this function is the same as GetGameMode(), use that function instead.
GetEquippedItem
cItem
Returns the item that the player is currently holding; empty item if holding nothing.
GetEyeHeight
number
Returns the height of the player's eyes, in absolute coords
GetEyePosition
EyePositionVectorVector3d
Returns the position of the player's eyes, as a Vector3d
GetFloaterID
number
Returns the Entity ID of the fishing hook floater that belongs to the player. Returns -1 if no floater is associated with the player. FIXME: Undefined behavior when the player has used multiple fishing rods simultanously.
GetFlyingMaxSpeed
number
Returns the maximum flying speed, relative to the default game flying speed. Defaults to 1, but plugins may modify it for faster or slower flying.
GetFoodExhaustionLevel
number
Returns the food exhaustion level
GetFoodLevel
number
Returns the food level (number of half-drumsticks on-screen)
GetFoodSaturationLevel
number
Returns the food saturation (overcharge of the food level, is depleted before food level)
GetFoodTickTimer
number
Returns the number of ticks past the last food-based heal or damage action; when this timer reaches 80, a new heal / damage is applied.
GetGameMode
GameModeeGameMode
Returns the player's gamemode. The player may have their gamemode unassigned, in which case they inherit the gamemode from the current world.
NOTE: Instead of comparing the value returned by this function to the gmXXX constants, use the IsGameModeXXX() functions. These functions handle the gamemode inheritance automatically.
GetIP
string
Returns the IP address of the player, if available. Returns an empty string if there's no IP to report.
GetInventory
InventorycInventory
Returns the player's inventory
GetLastBedPos
Vector3i
Returns the player's respawn position. The player is guaranteed to respawn from death here if cPlayer:IsRespawnPointForced is true or if a bed exists at this position.
GetMaxSpeed
number
Returns the player's current maximum speed, relative to the game default speed. Takes into account the sprinting / flying status.
GetName
string
Returns the player's name
GetNormalMaxSpeed
number
Returns the player's maximum walking speed, relative to the game default speed. Defaults to 1, but plugins may modify it for faster or slower walking.
GetPermissions
table
Returns an array-table of all permissions (strings) that the player has assigned to them through their rank.
GetPlayerListName
string
Returns the name that is used in the playerlist.
GetPrefix
string
Returns the prefix to player names for messages (based on their rank), may contain @ format codes.
GetRestrictions
table
Returns an array-table of all the restrictions that the player has assigned to them.
GetSkinParts
number
Returns the player's current set of skin part flags. This is a bitwise OR of various eSkinPart constants. Note that HasSkinPart may be easier to use in most situations.
GetSprintingMaxSpeed
number
Returns the player's maximum sprinting speed, relative to the game default speed. Defaults to 1.3, but plugins may modify it for faster or slower sprinting.
GetStatistics
StatisticsManager
Returns the player's statistics manager.
GetSuffix
string
Returns the suffix to player names for messages (based on their rank), may contain @ format codes.
GetTeam
cTeam
Returns the team that the player belongs to, or nil if none.
GetThrowSpeed
SpeedCoeffnumber
Vector3d
Returns the speed vector for an object thrown with the specified speed coeff. Basically returns the normalized look vector multiplied by the coeff, with a slight random variation.
GetThrowStartPos
Vector3d
Returns the position where the projectiles should start when thrown by this player.
GetUUID
string
Returns the (short) UUID that the player is using. Could be empty string for players that don't have a Mojang account assigned to them (in the future, bots for example).
GetWindow
cWindow
Returns the currently open UI window. If the player doesn't have any UI window open, returns the inventory window.
GetXpLevel
number
Returns the current XP level (based on current XP amount).
GetXpLifetimeTotal
number
Returns the amount of XP that has been accumulated throughout the player's lifetime.
GetXpPercentage
number
Returns the percentage of the experience bar - the amount of XP towards the next XP level. Between 0 and 1.
HasCustomName
boolean
Returns true if the player has a custom name.
HasPermission
PermissionStringstring
boolean
Returns true if the player has the specified permission
HasSkinPart
ParteSkinPart
boolean
Returns true if the player has the specified skin part enabled
Heal
HitPointsnumber
Heals the player by the specified amount of HPs. Only positive amounts are expected. Sends a health update to the client.
IsEating
boolean
Returns true if the player is currently eating the item in their hand.
IsFireproof
boolean
Returns true if a player is fireproof. This is when the flag has been explicitly set, or the player is in creative or spectator mode.
IsFishing
boolean
Returns true if the player is currently fishing
IsFlying
boolean
Returns true if the player is flying.
IsFrozen
boolean
Returns true if the player is frozen. See Freeze()
IsGameModeAdventure
boolean
Returns true if the player is in the gmAdventure gamemode, or has their gamemode unset and the world is a gmAdventure world.
IsGameModeCreative
boolean
Returns true if the player is in the gmCreative gamemode, or has their gamemode unset and the world is a gmCreative world.
IsGameModeSpectator
boolean
Returns true if the player is in the gmSpectator gamemode, or has their gamemode unset and the world is a gmSpectator world.
IsGameModeSurvival
boolean
Returns true if the player is in the gmSurvival gamemode, or has their gamemode unset and the world is a gmSurvival world.
IsInBed
boolean
Returns true if the player is currently lying in a bed.
IsLeftHanded
boolean
Returns true if the player's left hand is dominant.
IsRespawnPointForced
boolean
Returns true if the player unconditionally respawns from death at the position given by cPlayer:GetLastBedPos with no bed checks performed.
IsSatiated
boolean
Returns true if the player is satiated (cannot eat).
LoadRank Reloads the player's rank, message visuals and permissions from the cRankManager, based on the player's current rank.
OpenWindow
WindowcWindow
Opens the specified UI window for the player.
PermissionMatches
Permissionstring
Templatestring
boolean
(STATIC) Returns true if the specified permission matches the specified template. The template may contain asterisk as a wildcard for any word.
PlaceBlock
BlockPosVector3i
BlockTypenumber
BlockMetanumber
boolean
Places a block while impersonating the player. The HOOK_PLAYER_PLACING_BLOCK hook is called before the placement, and if it succeeds, the block is placed and the HOOK_PLAYER_PLACED_BLOCK hook is called. Returns true iff the block is successfully placed.
ReplaceOneEquippedItemTossRest
ItemcItem
Removes one item from the the current equipped item stack, and attempts to add the specified item stack back to the same slot. If it is not possible to place the item in the same slot, tries to place the specified item elsewhere in the inventory. If this is not possible, then any remaining items are tossed. If the currently equipped slot is empty, its contents are simply set to the given Item.
Respawn Restores the health, extinguishes fire, makes visible and sends the Respawn packet.
SendAboveActionBarMessage
Messagestring
Sends the specified message to the player (shows above action bar).
SendBlocksAround
BlockXnumber
BlockYnumber
BlockZnumber
BlockRangenumber
Sends all the world's blocks in BlockRange from the specified coords to the player, as a BlockChange packet. Range defaults to 1 (only one block sent).
SendMessage
Messagestring
Sends the specified message to the player.
SendMessage
MessagecCompositeChat
Sends the cCompositeChat to the player, using a severity defined by the CompositeChat's MessageType.
SendMessageFailure
Messagestring
Prepends Rose [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. For a command that failed to run because of insufficient permissions, etc.
SendMessageFatal
Messagestring
Prepends Red [FATAL] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. For something serious, such as a plugin crash, etc.
SendMessageInfo
Messagestring
Prepends Yellow [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. Informational message, such as command usage, etc.
SendMessagePrivateMsg
Messagestring
SenderNamestring
Prepends Light Blue [MSG: *SenderName*] / prepends SenderName and colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. For private messaging.
SendMessageRaw
Jsonstring
eChatTypenumber
Sends the specified json string to the player. The optional value eChatType (default ctChatBox) can be ctChatBox, ctSystem or ctAboveActionBar. You can use cJson to build a json string.
SendMessageSuccess
Messagestring
Prepends Green [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. Success notification.
SendMessageWarning
Messagestring
Prepends Rose [WARN] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. Denotes that something concerning, such as plugin reload, is about to happen.
SendRotation
YawDegreesnumber
PitchDegreesnumber
Sends the specified rotation to the player, forcing them to look that way
SendSystemMessage
Messagestring
Sends the specified message to the player.
SetBedPos
PositionVector3i
WorldcWorld
Sets the position and world of the player's bed. If the world is not specified, it is set to the player's current world. The player will respawn at this position and world upon death if there is a bed there.
SetCanFly
CanFlyboolean
Sets if the player can fly or not.
SetCrouch
IsCrouchedboolean
Sets the crouch state, broadcasts the change to other players.
SetCurrentExperience
XPAmountnumber
boolean
Sets the current amount of experience (and indirectly, the XP level).
SetCustomName
CustomNamestring
Sets the custom name for this player. If you want to disable the custom name, simply set an empty string. The custom name will be used in the tab-list, in the player nametag and in the tab-completion.
SetDraggingItem
ItemcItem
Sets the item that the player is dragging in a UI window. If no UI window is open, this function does nothing.
SetElytraFlight
IsElytraFlyingboolean
Sets whether the player is elytra flying or not.
SetFlying
IsFlyingboolean
Sets if the player is flying or not.
SetFlyingMaxSpeed
FlyingMaxSpeednumber
Sets the flying maximum speed, relative to the game default speed. The default value is 1. Sends the updated speed to the client.
SetFoodExhaustionLevel
ExhaustionLevelnumber
Sets the food exhaustion to the specified level.
SetFoodLevel
FoodLevelnumber
Sets the food level (number of half-drumsticks on-screen)
SetFoodSaturationLevel
FoodSaturationLevelnumber
Sets the food saturation (overcharge of the food level).
SetFoodTickTimer
FoodTickTimernumber
Sets the number of ticks past the last food-based heal or damage action; when this timer reaches 80, a new heal / damage is applied.
SetGameMode
NewGameModeeGameMode
Sets the gamemode for the player. The new gamemode overrides the world's default gamemode, unless it is set to gmInherit.
SetIsFishing
IsFishingboolean
FloaterEntityIDnumber
Sets the 'IsFishing' flag for the player. The floater entity ID is expected for the true variant, it can be omitted when IsFishing is false. FIXME: Undefined behavior when multiple fishing rods are used simultanously
SetLeftHanded
IsLeftHandedboolean
Sets the dominant hand of the player.
SetNormalMaxSpeed
NormalMaxSpeednumber
Sets the normal (walking) maximum speed, relative to the game default speed. The default value is 1. Sends the updated speed to the client, if appropriate.
SetRespawnPosition
PositionVector3i
WorldcWorld
Sets the position and world of the player's respawn point. The player will respawn at this position and world upon death.
SetSkinParts
Partsnumber
Sets the skin part flags of the player. The value should be a bitwise OR of several eSkinPart constants.
SetSprint
IsSprintingboolean
Sets whether the player is sprinting or not.
SetSprintingMaxSpeed
SprintingMaxSpeednumber
Sets the sprinting maximum speed, relative to the game default speed. The default value is 1.3. Sends the updated speed to the client, if appropriate.
SetTeam
TeamcTeam
Moves the player to the specified team.
SetVisible
IsVisibleboolean
Sets the player visibility to other players
SpectateEntity
TargetcEntity
Spectates the target entity. Does not change the player's gamemode to spectator mode. When called with self or nil as the target, resets the spectation.
TossEquippedItem
Amountnumber
Tosses the item that the player has selected in their hotbar. Amount defaults to 1.
TossHeldItem
Amountnumber
Tosses the item held by the cursor, when the player is in a UI window. Amount defaults to 1.
TossPickup
ItemcItem
Tosses a pickup newly created from the specified item.
Unfreeze Allows the player to move again, canceling the effects of Freeze()
XpForLevel
XPLevelnumber
number
(STATIC) Returns the total amount of XP needed for the specified XP level. Inverse of CalcLevelFromXp().

Functions inherited from cPawn

NameParametersReturn valueNotes
AddEntityEffect
EffectTypeeType
EffectDurationTicksnumber
EffectIntensitynumber
DistanceModifiernumber
Applies an entity effect. Checks with plugins if they allow the addition. EffectIntensity is the level of the effect (0 = Potion I, 1 = Potion II, etc). DistanceModifier is the scalar multiplied to the potion duration (only applies to splash potions).
ClearEntityEffects Removes all currently applied entity effects
FindTeleportDestination
WorldcWorld
HeightRequirednumber
NumTriesnumber
DestinationVector3d
MinBoxCornerVector3i
MaxBoxCornerVector3i
Function to find suitable teleport destination in or below box. Returns true and places result in Destination if found, otherwise returns false. Details at: https://minecraft.fandom.com/wiki/Enderman.
FindTeleportDestination
WorldcWorld
HeightRequirednumber
NumTriesnumber
DestinationVector3d
BoundingBoxcBoundingBox
Function to find suitable teleport destination in or below box. Returns true and places result in Destination if found, otherwise returns false. Details at: https://minecraft.fandom.com/wiki/Enderman.
FindTeleportDestination
WorldcWorld
HeightRequirednumber
NumTriesnumber
CentreVector3i
HalfCubeWidthnumber
Function to find suitable teleport destination in or below box. Returns true and places result in Destination if found, otherwise returns false. Details at: https://minecraft.fandom.com/wiki/Enderman.
HasEntityEffect
EffectTypeeType
boolean
Returns true, if the supplied entity effect type is currently applied
RemoveEntityEffect
EffectTypeeType
Removes a currently applied entity effect

Functions inherited from cEntity

NameParametersReturn valueNotes
AddPosX
OffsetXnumber
Moves the entity by the specified amount in the X axis direction
AddPosY
OffsetYnumber
Moves the entity by the specified amount in the Y axis direction
AddPosZ
OffsetZnumber
Moves the entity by the specified amount in the Z axis direction
AddPosition
OffsetVector3d
Moves the entity by the specified amount in each direction
AddPosition
OffsetXnumber
OffsetYnumber
OffsetZnumber
Moves the entity by the specified amount in each axis direction
AddSpeed
AddXnumber
AddYnumber
AddZnumber
Adds the specified amount of speed in each axis direction.
AddSpeed
AddVector3d
Adds the specified amount of speed in each axis direction.
AddSpeedX
AddXnumber
Adds the specified amount of speed in the X axis direction.
AddSpeedY
AddYnumber
Adds the specified amount of speed in the Y axis direction.
AddSpeedZ
AddZnumber
Adds the specified amount of speed in the Z axis direction.
ApplyArmorDamage
DamageBlockednumber
Lowers armor durability, as if the armor blocked the given amount of damage.
ArmorCoversAgainst
DamageTypeeDamageType
boolean
Returns whether armor will protect against the specified damage type
Destroy
ShouldBroadcast (DEPRECATED)boolean
Schedules the entity to be destroyed; broadcasts the DestroyEntity packet
DoesPreventBlockPlacement
boolean
Returns true if this entity doesn't allow blocks to be placed intersecting the entity.
GetAirDrag (undocumented)
GetAirLevel
number
Returns the air level (number of ticks of air left). Note, this function is only updated with mobs or players.
GetArmorCoverAgainst
AttackerEntitycEntity
DamageTypeeDamageType
RawDamagenumber
number
Returns the number of hitpoints out of RawDamage that the currently equipped armor would cover. See TakeDamageInfo for more information on attack damage.
GetBoundingBox
cBoundingBox
Returns the bounding box of the entity, which has width and height corresponding to the entity, and is aligned with the block grid.
GetChunkX
number
Returns the X-coord of the chunk in which the entity is placed
GetChunkZ
number
Returns the Z-coord of the chunk in which the entity is placed
GetClass
string
Returns the classname of the entity, such as "cSpider" or "cPickup"
GetClassStatic
string
(STATIC) Returns the entity classname that this class implements. Each descendant overrides this function.
GetEnchantmentBlastKnockbackReduction
number
Returns explosion knock back reduction percent from blast protection level.
GetEnchantmentCoverAgainst
AttackerEntitycEntity
DamageTypeeDamageType
RawDamagenumber
number
Returns the number of hitpoints out of RawDamage that the enchantments on the currently equipped armor would cover. See TakeDamageInfo for more information on attack damage.
GetEntityType
EntityTypeeEntityType
Returns the type of the entity, one of the etXXX constants. Note that to check specific entity type, you should use one of the IsXXX functions instead of comparing the value returned by this call.
GetEquippedBoots
cItem
Returns the boots that the entity has equipped. Returns an empty cItem if no boots equipped or not applicable.
GetEquippedChestplate
cItem
Returns the chestplate that the entity has equipped. Returns an empty cItem if no chestplate equipped or not applicable.
GetEquippedHelmet
cItem
Returns the helmet that the entity has equipped. Returns an empty cItem if no helmet equipped or not applicable.
GetEquippedLeggings
cItem
Returns the leggings that the entity has equipped. Returns an empty cItem if no leggings equipped or not applicable.
GetEquippedWeapon
cItem
Returns the weapon that the entity has equipped. Returns an empty cItem if no weapon equipped or not applicable.
GetGravity
number
Returns the number that is used as the gravity for physics simulation. 1G (9.78) by default.
GetHeadYaw
number
Returns the pitch of the entity's head (FIXME: Rename to GetHeadPitch() ).
GetHealth
number
Returns the current health of the entity.
GetHeight
number
Returns the height (Y size) of the entity
GetInvulnerableTicks
number
Returns the number of ticks that this entity will be invulnerable for. This is used for after-hit recovery - the entities are invulnerable for half a second after being hit.
GetKnockbackAmountAgainst
ReceiverEntitycEntity
number
Returns the amount of knockback that the currently equipped items would cause when attacking the ReceiverEntity.
GetLookVector
Vector3f
Returns the vector that defines the direction in which the entity is looking
GetMass
number
Returns the mass of the entity. Currently unused.
GetMaxHealth
number
Returns the maximum number of hitpoints this entity is allowed to have.
GetOffHandEquipedItem
cItem
Returns the item that the entity has equipped on off-hand. Returns an empty cItem if no item equipped or not applicable.
GetParentClass
string
Returns the name of the direct parent class for this entity
GetPitch
number
Returns the pitch (nose-down rotation) of the entity. Measured in degrees, normal values range from -90 to +90. +90 means looking down, 0 means looking straight ahead, -90 means looking up.
GetPosX
number
Returns the X-coord of the entity's pivot
GetPosY
number
Returns the Y-coord of the entity's pivot
GetPosZ
number
Returns the Z-coord of the entity's pivot
GetPosition
Vector3d
Returns the entity's pivot position as a 3D vector
GetRawDamageAgainst
ReceiverEntitycEntity
number
Returns the raw damage that this entity's equipment would cause when attacking the ReceiverEntity. This includes this entity's weapon enchantments, but excludes the receiver's armor or potion effects. See TakeDamageInfo for more information on attack damage.
GetRoll
number
Returns the roll (sideways rotation) of the entity. Currently unused.
GetSpeed
Vector3d
Returns the complete speed vector of the entity
GetSpeedX
number
Returns the X-part of the speed vector
GetSpeedY
number
Returns the Y-part of the speed vector
GetSpeedZ
number
Returns the Z-part of the speed vector
GetTicksAlive
number
Returns the number of ticks that this entity has been alive for.
GetUniqueID
number
Returns the ID that uniquely identifies the entity within the running server. Note that this ID is not persisted to the data files.
GetWidth
number
Returns the width (X and Z size) of the entity.
GetWorld
cWorld
Returns the world where the entity resides
GetYaw
number
Returns the yaw (direction) of the entity. Measured in degrees, values range from -180 to +180. 0 means ZP, 90 means XM, -180 means ZM, -90 means XP.
HandleSpeedFromAttachee
ForwardAmountnumber
SidewaysAmountnumber
Updates the entity's speed based on the attachee exerting the specified force forward and sideways. Used for entities being driven by other entities attached to them - usually players driving minecarts and boats.
Heal
Hitpointsnumber
Heals the specified number of hitpoints. Hitpoints is expected to be a positive number.
IsA
ClassNamestring
boolean
Returns true if the entity class is a descendant of the specified class name, or the specified class itself
IsArrow
boolean
Returns true if the entity is an arrow.
IsBoat
boolean
Returns true if the entity is a boat.
IsCrouched
boolean
Returns true if the entity is crouched. Always false for entities that don't support crouching.
IsDestroyed
boolean
(DEPRECATED) Please use cEntity:IsTicking().
IsElytraFlying
boolean
Returns true if the entity is flying with an elytra. Entities that cannot fly with an elytra return always false.
IsEnderCrystal
boolean
Returns true if the entity is an ender crystal.
IsExpOrb
boolean
Returns true if the entity represents an experience orb
IsFallingBlock
boolean
Returns true if the entity represents a cFallingBlock entity.
IsFireproof
boolean
Returns true if the entity takes no damage from being on fire.
IsFloater
boolean
Returns true if the entity represents a fishing rod floater
IsHeadInWater
boolean
Returns true if the entity's head is in a water block
IsInFire
boolean
Returns true if any part of the entity is in a fire block
IsInLava
boolean
Returns true if any part of the entity is in a lava block
IsInWater
boolean
Returns true if any part of the entity is in a water block
IsInvisible
boolean
Returns true if the entity is invisible.
IsItemFrame
boolean
Returns true if the entity is an item frame.
IsLeashKnot
boolean
Returns true if the entity is a leash knot.
IsMinecart
boolean
Returns true if the entity represents a minecart
IsMob
boolean
Returns true if the entity represents any mob.
IsOnFire
boolean
Returns true if the entity is on fire
IsOnGround
boolean
Returns true if the entity is on ground (not falling, not jumping, not flying)
IsPainting
boolean
Returns if this entity is a painting.
IsPawn
boolean
Returns true if the entity is a cPawn descendant.
IsPickup
boolean
Returns true if the entity represents a pickup.
IsPlayer
boolean
Returns true if the entity represents a player
IsProjectile
boolean
Returns true if the entity is a cProjectileEntity descendant.
IsRclking
boolean
Currently unimplemented
IsRiding
boolean
Returns true if the entity is attached to (riding) another entity.
IsSprinting
boolean
Returns true if the entity is sprinting. Entities that cannot sprint return always false
IsSubmerged
boolean
Returns true if the entity's head is in a water block Currently deprecated in favour of IsHeadInWater()
IsSwimming
boolean
Returns true if any part of the entity is in a water block. Note, this function is only updated with mobs or players. Currently deprecated in favour of IsInWater()
IsTNT
boolean
Returns true if the entity represents a TNT entity
IsTicking
boolean
Returns true if the entity is valid and ticking. Returns false if the entity is not ticking and is about to leave its current world either via teleportation or destruction. If this returns false, you must stop using the cEntity pointer you have.
Killed
VictimcEntity
This entity has killed another entity (the Victim). For players, adds the scoreboard statistics about the kill.
MoveToWorld
WorldNamestring
ShouldSendRespawnboolean
boolean
Removes the entity from this world and starts moving it to the specified world's spawn point. Note that to avoid deadlocks, the move is asynchronous - the entity is moved into a queue and will be moved from that queue into the destination world at some (unpredictable) time in the future. ShouldSendRespawn is used only for players, it specifies whether the player should be sent a Respawn packet upon leaving the world (The client handles respawns only between different dimensions).
MoveToWorld
WorldcWorld
ShouldSendRespawnboolean
boolean
Removes the entity from this world and starts moving it to the specified world's spawn point. Note that to avoid deadlocks, the move is asynchronous - the entity is moved into a queue and will be moved from that queue into the destination world at some (unpredictable) time in the future. ShouldSendRespawn is used only for players, it specifies whether the player should be sent a Respawn packet upon leaving the world (The client handles respawns only between different dimensions).
MoveToWorld
WorldcWorld
ShouldSendRespawnboolean
PositionVector3d
boolean
Removes the entity from this world and starts moving it to the specified world. Note that to avoid deadlocks, the move is asynchronous - the entity is moved into a queue and will be moved from that queue into the destination world at some (unpredictable) time in the future. ShouldSendRespawn is used only for players, it specifies whether the player should be sent a Respawn packet upon leaving the world (The client handles respawns only between different dimensions). The Position parameter specifies the location that the entity should be placed in, in the new world.
MoveToWorld
WorldcWorld
PositionVector3d
ShouldSetPortalCooldownboolean
ShouldSendRespawnboolean
boolean
Removes the entity from this world and starts moving it to the specified world. Note that to avoid deadlocks, the move is asynchronous - the entity is moved into a queue and will be moved from that queue into the destination world at some (unpredictable) time in the future. If ShouldSetPortalCooldown is false (default), doesn't set any portal cooldown, if it is true, the default portal cooldown is applied to the entity. ShouldSendRespawn is used only for players, it specifies whether the player should be sent a Respawn packet upon leaving the world (The client handles respawns only between different dimensions). The Position parameter specifies the location that the entity should be placed in, in the new world.
SetAirDrag (undocumented)
SetGravity
Gravitynumber
Sets the number that is used as the gravity for physics simulation. 1G (9.78) by default.
SetHeadYaw
HeadPitchnumber
Sets the head pitch (FIXME: Rename to SetHeadPitch() ).
SetHealth
Hitpointsnumber
Sets the entity's health to the specified amount of hitpoints. Doesn't broadcast any hurt animation. Doesn't kill the entity if health drops below zero. Use the TakeDamage() function instead for taking damage.
SetInvulnerableTicks
NumTicksnumber
Sets the amount of ticks for which the entity will not receive any damage from other entities.
SetIsFireproof
IsFireproofboolean
Sets whether the entity receives damage from being on fire.
SetMass
Massnumber
Sets the mass of the entity. Currently unused.
SetMaxHealth
MaxHitpointsnumber
Sets the maximum hitpoints of the entity. If current health is above MaxHitpoints, it is capped to MaxHitpoints.
SetPitch
Pitchnumber
Sets the pitch (nose-down rotation) of the entity
SetPitchFromSpeed Sets the entity pitch to match its speed (entity looking forwards as it moves)
SetPosX
PosXnumber
Sets the X-coord of the entity's pivot
SetPosY
PosYnumber
Sets the Y-coord of the entity's pivot
SetPosZ
PosZnumber
Sets the Z-coord of the entity's pivot
SetPosition
Vector3dVector3d
Sets all three coords of the entity's pivot
SetPosition
PosXnumber
PosYnumber
PosZnumber
Sets all three coords of the entity's pivot
SetRoll
Rollnumber
Sets the roll (sideways rotation) of the entity. Currently unused.
SetSpeed
SpeedVector3d
Sets the current speed of the entity
SetSpeed
SpeedXnumber
SpeedYnumber
SpeedZnumber
Sets the current speed of the entity
SetSpeedX
SpeedXnumber
Sets the X component of the entity speed
SetSpeedY
SpeedYnumber
Sets the Y component of the entity speed
SetSpeedZ
SpeedZnumber
Sets the Z component of the entity speed
SetYaw
Yawnumber
Sets the yaw (direction) of the entity.
SetYawFromSpeed Sets the entity's yaw to match its current speed (entity looking forwards as it moves).
StartBurning
NumTicksnumber
Sets the entity on fire for the specified number of ticks. If entity is on fire already, makes it burn for either NumTicks or the number of ticks left from the previous fire, whichever is larger.
SteerVehicle
ForwardAmountnumber
SidewaysAmountnumber
Applies the specified steering to the vehicle this entity is attached to. Ignored if not attached to any entity.
StopBurning Extinguishes the entity fire, cancels all fire timers.
TakeDamage
AttackerEntitycEntity
Causes this entity to take damage that AttackerEntity would inflict. Includes their weapon and this entity's armor.
TakeDamage
DamageTypeeDamageType
AttackerEntitycEntity
RawDamagenumber
FinalDamagenumber
KnockbackAmountnumber
Causes this entity to take damage of the specified type, from the specified attacker (may be nil). The values are wrapped into a TakeDamageInfo structure and applied directly.
TakeDamage
DamageTypeeDamageType
AttackerEntitycEntity
RawDamagenumber
KnockbackAmountnumber
Causes this entity to take damage of the specified type, from the specified attacker (may be nil). The final damage is calculated from RawDamage using the currently equipped armor.
TeleportToCoords
PosXnumber
PosYnumber
PosZnumber
Teleports the entity to the specified coords. Asks plugins if the teleport is allowed.
TeleportToEntity
DestEntitycEntity
Teleports this entity to the specified destination entity. Asks plugins if the teleport is allowed.
Generated by APIDump on 2022-10-28 17:00:47, Build ID Unknown, Commit approx: 21ec3ebe26bff24b5fc6d96f86a441c9c9628247