5 #include "../Entities/Player.h" 13 super(
"Pig",
mtPig,
"entity.pig.hurt",
"entity.pig.death", 0.9, 0.9),
29 unsigned int LootingLevel = 0;
30 if (a_Killer !=
nullptr)
double GetPosY(void) const
virtual UInt32 SpawnMob(double a_PosX, double a_PosY, double a_PosZ, eMonsterType a_MonsterType, bool a_Baby=false) override
Spawns a mob of the specified type.
double GetPosX(void) const
bool RemoveOneEquippedItem(void)
Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed.
virtual void BroadcastEntityMetadata(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual void Detach(void)
Detaches from the currently attached entity, if any.
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
When hit by someone, run away.
const cItem & GetEquippedItem(void) const
virtual bool IsOnFire(void) const
virtual void Detach(void) override
Detaches from the currently attached entity, if any.
void AddRandomDropItem(cItems &a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth=0)
Adds a random number of a_Item between a_Min and a_Max to itemdrops a_Drops.
unsigned int GetLevel(int a_EnchantmentID) const
Returns the level for the specified enchantment; 0 if not stored.
virtual void MoveToPosition(const Vector3d &a_Position)
Engage pathfinder and tell it to calculate a path to a given position, and move the mob accordingly...
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
cEnchantments m_Enchantments
Vector3d GetLookVector(void) const
bool IsTicking(void) const
Returns true if the entity is valid and ticking.
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
When hit by someone, run away.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void Destroy(bool a_ShouldBroadcast=true) override
Destroys the entity and schedules it for memory freeing; if a_ShouldBroadcast is set to true...
bool IsPlayer(void) const
virtual void AttachTo(cEntity *a_AttachTo) override
Attaches to the specified entity; detaches from any previous one first.
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
virtual cItem GetEquippedWeapon(void) const
Returns the curently equipped weapon; empty item if none.
const Vector3d & GetPosition(void) const
Exported in ManualBindings.
cEntity * m_Attachee
The entity which is attached to this entity (rider), nullptr if none.
double GetPosZ(void) const
bool IsGameModeCreative(void) const
Returns true if the player is in Creative mode, either explicitly, or by inheriting from current worl...
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
cInventory & GetInventory(void)
UInt32 GetUniqueID(void) const
This class bridges a vector of cItem for safe access via Lua.