cPawn


Index:
Articles
Classes
Hooks

Quick navigation:
cArrowEntity
cBeaconEntity
cBlockArea
cBlockEntity
cBlockEntityWithItems
cBlockInfo
cBoundingBox
cBrewingstandEntity
cChatColor
cChestEntity
cChunkDesc
cClientHandle
cCommandBlockEntity
cCompositeChat
cCraftingGrid
cCraftingRecipe
cCryptoHash
cCuboid
cDispenserEntity
cDropperEntity
cDropSpenserEntity
cEnchantments
cEntity
cEntityEffect
cExpBottleEntity
cFile
cFireChargeEntity
cFireworkEntity
cFloater
cFlowerPotEntity
cFurnaceEntity
cGhastFireballEntity
cHangingEntity
cHopperEntity
cIniFile
cInventory
cItem
cItemFrame
cItemGrid
cItems
cJson
cJukeboxEntity
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
cStatManager
cStringCompression
cTCPLink
cTeam
cThrownEggEntity
cThrownEnderPearlEntity
cThrownSnowballEntity
cTNTEntity
cTracer
cUDPEndpoint
cUrlClient
cUrlParser
cWebAdmin
cWindow
cWitherSkullEntity
cWorld
HTTPFormData
HTTPRequest
HTTPTemplateRequest
ItemCategory
lxp
sqlite3
TakeDamageInfo
tolua
Vector3d
Vector3f
Vector3i
Globals

Contents


cPawn class

cPawn is a controllable pawn object, controlled by either AI or a player. cPawn inherits all functions and members of cEntity


Inheritance

This class inherits from the following parent classes:

This class has the following descendants:


Constants

Constants inherited from cEntity

NameValueNotes
INVALID_ID 0

Functions

NameParametersReturn valueNotes
AddEntityEffect EffectType, EffectDurationTicks, EffectIntensity, DistanceModifier 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
HasEntityEffect EffectType bool Returns true, if the supplied entity effect type is currently applied
RemoveEntityEffect EffectType Removes a currently applied entity effect

Functions inherited from cEntity

NameParametersReturn valueNotes
AddPosX OffsetX Moves the entity by the specified amount in the X axis direction
AddPosY OffsetY Moves the entity by the specified amount in the Y axis direction
AddPosZ OffsetZ Moves the entity by the specified amount in the Z axis direction
AddPosition OffsetX, OffsetY, OffsetZ Moves the entity by the specified amount in each axis direction
AddPosition Offset Moves the entity by the specified amount in each direction
AddSpeed AddX, AddY, AddZ Adds the specified amount of speed in each axis direction.
AddSpeed Add Adds the specified amount of speed in each axis direction.
AddSpeedX AddX Adds the specified amount of speed in the X axis direction.
AddSpeedY AddY Adds the specified amount of speed in the Y axis direction.
AddSpeedZ AddZ Adds the specified amount of speed in the Z axis direction.
ArmorCoversAgainst DamageType boolean Returns whether armor will protect against the specified damage type
Destroy [ShouldBroadcast] Schedules the entity to be destroyed; if ShouldBroadcast is not present or set to true, broadcasts the DestroyEntity packet
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 AttackerEntity, DamageType, RawDamage number Returns the number of hitpoints out of RawDamage that the currently equipped armor would cover. See TakeDamageInfo for more information on attack damage.
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 Returns the entity classname that this class implements. Each descendant overrides this function. Is static
GetEntityType EntityType 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 ReceiverEntity 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.
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 ReceiverEntity 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 ForwardAmount, SidewaysAmount 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 Hitpoints Heals the specified number of hitpoints. Hitpoints is expected to be a positive number.
IsA ClassName bool Returns true if the entity class is a descendant of the specified class name, or the specified class itself
IsBoat bool Returns true if the entity is a boat.
IsCrouched bool Returns true if the entity is crouched. Always false for entities that don't support crouching.
IsDestroyed bool (DEPRECATED) Please use cEntity:IsTicking().
IsEnderCrystal bool Returns true if the entity is an ender crystal.
IsExpOrb bool Returns true if the entity represents an experience orb
IsFallingBlock bool Returns true if the entity represents a cFallingBlock entity.
IsFireproof bool Returns true if the entity takes no damage from being on fire.
IsFloater bool Returns true if the entity represents a fishing rod floater
IsInvisible bool Returns true if the entity is invisible
IsItemFrame bool Returns true if the entity is an item frame.
IsMinecart bool Returns true if the entity represents a minecart
IsMob bool Returns true if the entity represents any mob.
IsOnFire bool Returns true if the entity is on fire
IsOnGround bool Returns true if the entity is on ground (not falling, not jumping, not flying)
IsPainting bool Returns if this entity is a painting.
IsPawn bool Returns true if the entity is a cPawn descendant.
IsPickup bool Returns true if the entity represents a pickup.
IsPlayer bool Returns true if the entity represents a player
IsProjectile bool Returns true if the entity is a cProjectileEntity descendant.
IsRclking bool Currently unimplemented
IsRiding bool Returns true if the entity is attached to (riding) another entity.
IsSprinting bool Returns true if the entity is sprinting. Entities that cannot sprint return always false
IsSubmerged bool Returns true if the mob or player is submerged in water (head is in a water block). Note, this function is only updated with mobs or players.
IsSwimming bool Returns true if the mob or player is swimming in water (feet are in a water block). Note, this function is only updated with mobs or players.
IsTNT bool Returns true if the entity represents a TNT entity
IsTicking bool 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 Victim This entity has killed another entity (the Victim). For players, adds the scoreboard statistics about the kill.
MoveToWorld WorldName, [ShouldSendRespawn] bool 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 Repawn packet upon leaving the world (The client handles respawns only between different dimensions). OBSOLETE, use ScheduleMoveToWorld() instead.
MoveToWorld World, ShouldSendRespawn, Position bool 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 Repawn 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. OBSOLETE, use ScheduleMoveToWorld() instead.
MoveToWorld World, [ShouldSendRespawn] bool 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 Repawn packet upon leaving the world (The client handles respawns only between different dimensions). OBSOLETE, use ScheduleMoveToWorld() instead.
ScheduleMoveToWorld World, NewPosition, [ShouldSetPortalCooldown] Schedules a MoveToWorld call to occur on the next Tick of the entity. If ShouldSetPortalCooldown is false (default), doesn't set any portal cooldown, if it is true, the default portal cooldown is applied to the entity.
SetAirDrag (undocumented)
SetGravity Gravity Sets the number that is used as the gravity for physics simulation. 1G (9.78) by default.
SetHeadYaw HeadPitch Sets the head pitch (FIXME: Rename to SetHeadPitch() ).
SetHealth Hitpoints 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.
SetHeight FIXME: Remove this from API
SetInvulnerableTicks NumTicks Sets the amount of ticks for which the entity will not receive any damage from other entities.
SetIsFireproof IsFireproof Sets whether the entity receives damage from being on fire.
SetMass Mass Sets the mass of the entity. Currently unused.
SetMaxHealth MaxHitpoints Sets the maximum hitpoints of the entity. If current health is above MaxHitpoints, it is capped to MaxHitpoints.
SetPitch number 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 number Sets the X-coord of the entity's pivot
SetPosY number Sets the Y-coord of the entity's pivot
SetPosZ number Sets the Z-coord of the entity's pivot
SetPosition PosX, PosY, PosZ Sets all three coords of the entity's pivot
SetPosition Vector3d Sets all three coords of the entity's pivot
SetRoll number Sets the roll (sideways rotation) of the entity. Currently unused.
SetSpeed SpeedX, SpeedY, SpeedZ Sets the current speed of the entity
SetSpeed Speed Sets the current speed of the entity
SetSpeedX SpeedX Sets the X component of the entity speed
SetSpeedY SpeedY Sets the Y component of the entity speed
SetSpeedZ SpeedZ Sets the Z component of the entity speed
SetWidth FIXME: Remove this from API
SetYaw number 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 NumTicks 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 ForwardAmount, SidewaysAmount 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 AttackerEntity Causes this entity to take damage that AttackerEntity would inflict. Includes their weapon and this entity's armor.
TakeDamage DamageType, ArrackerEntity, RawDamage, FinalDamage, KnockbackAmount 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 DamageType, AttackerEntity, RawDamage, KnockbackAmount 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 PosX, PosY, PosZ Teleports the entity to the specified coords. Asks plugins if the teleport is allowed.
TeleportToEntity DestEntity Teleports this entity to the specified destination entity. Asks plugins if the teleport is allowed.
Generated on 2016-08-22 23:53:06, Build ID Unknown, Commit approx: 2ed4af74edd14ae17e1c6c64d44caa7b7fc30d5a