Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::LivingEntity Class Reference

#include <LivingEntity.hpp>

Inheritance diagram for Botcraft::LivingEntity:
Botcraft::Entity Botcraft::ArmorStandEntity Botcraft::MobEntity Botcraft::PlayerEntity Botcraft::AmbientCreatureEntity Botcraft::EnderDragonEntity Botcraft::FlyingMobEntity Botcraft::PathfinderMobEntity Botcraft::SlimeEntity Botcraft::LocalPlayer Botcraft::BatEntity Botcraft::GhastEntity Botcraft::PhantomEntity Botcraft::AbstractGolemEntity Botcraft::AgeableMobEntity Botcraft::AllayEntity Botcraft::MonsterEntity Botcraft::WaterAnimalEntity Botcraft::MagmaCubeEntity

Public Member Functions

 LivingEntity ()
 
virtual ~LivingEntity ()
 
virtual bool IsLivingEntity () const override
 
virtual ProtocolCraft::Json::Value Serialize () const override
 
virtual void SetMetadataValue (const int index, const std::any &value) override
 
char GetDataLivingEntityFlags () const
 
float GetDataHealthId () const
 
std::vector< ProtocolCraft::ParticleGetDataEffectParticles () const
 
bool GetDataEffectAmbienceId () const
 
int GetDataArrowCountId () const
 
int GetDataStingerCountId () const
 
std::optional< PositionGetSleepingPosId () const
 
void SetDataLivingEntityFlags (const char data_living_entity_flags)
 
void SetDataHealthId (const float data_health_id)
 
void SetDataEffectParticles (const std::vector< ProtocolCraft::Particle > &data_effect_particles)
 
void SetDataEffectAmbienceId (const bool data_effect_ambience_id)
 
void SetDataArrowCountId (const int data_arrow_count_id)
 
void SetDataStingerCountId (const int data_stinger_count_id)
 
void SetSleepingPosId (const std::optional< Position > &sleeping_pos_id)
 
std::optional< EntityAttributeGetAttribute (const EntityAttribute::Type type) const
 
void SetAttributeBaseValue (const EntityAttribute::Type type, const double value)
 
void RemoveAttributeModifier (const EntityAttribute::Type type, const EntityAttribute::ModifierKey &key)
 
void SetAttributeModifier (const EntityAttribute::Type type, const EntityAttribute::ModifierKey &key, const EntityAttribute::Modifier &modifier)
 
void ClearModifiers (const EntityAttribute::Type type)
 
void AddAttribute (const EntityAttribute &attribute)
 
double GetAttributeMaxHealthValue () const
 
double GetAttributeKnockbackResistanceValue () const
 
double GetAttributeMovementSpeedValue () const
 
double GetAttributeArmorValue () const
 
double GetAttributeArmorToughnessValue () const
 
double GetAttributeMaxAbsorptionValue () const
 
double GetAttributeStepHeightValue () const
 
double GetAttributeScaleValue () const
 
double GetAttributeGravityValue () const
 
double GetAttributeSafeFallDistanceValue () const
 
double GetAttributeFallDamageMultiplierValue () const
 
double GetAttributeJumpStrengthValue () const
 
double GetAttributeOxygenBonusValue () const
 
double GetAttributeBurningTimeValue () const
 
double GetAttributeExplosionKnockbackResistanceValue () const
 
double GetAttributeWaterMovementEfficiencyValue () const
 
double GetAttributeMovementEfficiencyValue () const
 
double GetAttributeAttackKnockbackValue () const
 
- Public Member Functions inherited from Botcraft::Entity
 Entity ()
 
virtual ~Entity ()
 
virtual std::string GetName () const =0
 
virtual EntityType GetType () const =0
 
AABB GetCollider () const
 
double GetWidth () const
 
double GetHeight () const
 
void LoadMetadataFromRawArray (const std::vector< unsigned char > &data)
 
char GetDataSharedFlagsId () const
 
bool GetDataSharedFlagsId (const EntitySharedFlagsId id) const
 
int GetDataAirSupplyId () const
 
std::optional< ProtocolCraft::ChatGetDataCustomName () const
 
bool GetDataCustomNameVisible () const
 
bool GetDataSilent () const
 
bool GetDataNoGravity () const
 
Pose GetDataPose () const
 
int GetDataTicksFrozen () const
 
void SetDataSharedFlagsId (const char data_shared_flags_id)
 
void SetDataSharedFlagsId (const EntitySharedFlagsId id, const bool b)
 
void SetDataAirSupplyId (const int data_air_supply_id)
 
void SetDataCustomName (const std::optional< ProtocolCraft::Chat > &data_custom_name)
 
void SetDataCustomNameVisible (const bool data_custom_name_visible)
 
void SetDataSilent (const bool data_silent)
 
void SetDataNoGravity (const bool data_no_gravity)
 
void SetDataPose (const Pose data_pose)
 
void SetDataTicksFrozen (const int data_ticks_frozen)
 
int GetEntityID () const
 
ProtocolCraft::UUID GetUUID () const
 
Vector3< double > GetPosition () const
 
double GetX () const
 
double GetY () const
 
double GetZ () const
 
float GetYaw () const
 
float GetPitch () const
 
Vector3< double > GetSpeed () const
 
double GetSpeedX () const
 
double GetSpeedY () const
 
double GetSpeedZ () const
 
bool GetOnGround () const
 
std::map< EquipmentSlot, ProtocolCraft::SlotGetEquipments () const
 
ProtocolCraft::Slot GetEquipment (const EquipmentSlot slot) const
 
std::vector< EntityEffectGetEffects () const
 
std::vector< Renderer::FaceGetFaces (const bool reset_uptodate_status)
 
bool GetAreRenderedFacesUpToDate () const
 
void SetEntityID (const int entity_id_)
 
void SetUUID (const ProtocolCraft::UUID &uuid_)
 
virtual void SetPosition (const Vector3< double > &position_)
 
virtual void SetX (const double x_)
 
virtual void SetY (const double y_)
 
virtual void SetZ (const double z_)
 
virtual void SetYaw (const float yaw_)
 
virtual void SetPitch (const float pitch_)
 
void SetSpeed (const Vector3< double > &speed_)
 
void SetSpeedX (const double speed_x_)
 
void SetSpeedY (const double speed_y_)
 
void SetSpeedZ (const double speed_z_)
 
void SetOnGround (const bool on_ground_)
 
void SetEquipment (const EquipmentSlot slot, const ProtocolCraft::Slot &item)
 
void SetEffects (const std::vector< EntityEffect > &effects_)
 
void AddEffect (const EntityEffect &effect)
 
void RemoveEffect (const EntityEffectType type)
 
void SetAreRenderedFacesUpToDate (const bool are_rendered_faces_up_to_date_)
 
virtual bool IsLocalPlayer () const
 
virtual bool IsRemotePlayer () const
 
virtual bool IsAbstractArrow () const
 
virtual bool IsAnimal () const
 
virtual bool IsAmbientCreature () const
 
virtual bool IsMonster () const
 
virtual bool IsDisplay () const
 
virtual bool IsVehicle () const
 
virtual bool IsTamableAnimal () const
 
virtual bool IsAbstractSchoolingFish () const
 
virtual bool IsWaterAnimal () const
 
virtual bool IsAbstractChestedHorse () const
 
virtual bool IsAbstractHurtingProjectile () const
 
virtual bool IsMob () const
 
virtual bool IsSpellcasterIllager () const
 
virtual bool IsProjectile () const
 
virtual bool IsFlyingMob () const
 
virtual bool IsAbstractHorse () const
 
virtual bool IsAbstractGolem () const
 
virtual bool IsHangingEntity () const
 
virtual bool IsFireball () const
 
virtual bool IsAbstractMinecart () const
 
virtual bool IsAbstractMinecartContainer () const
 
virtual bool IsShoulderRidingEntity () const
 
virtual bool IsAbstractPiglin () const
 
virtual bool IsAbstractIllager () const
 
virtual bool IsAbstractFish () const
 
virtual bool IsRaider () const
 
virtual bool IsAbstractSkeleton () const
 
virtual bool IsThrowableItemProjectile () const
 
virtual bool IsAbstractVillager () const
 
virtual bool IsAgeableMob () const
 
virtual bool IsPathfinderMob () const
 
virtual bool IsPatrollingMonster () const
 
virtual bool IsThrowableProjectile () const
 
virtual bool IsAbstractWindCharge () const
 
virtual bool IsBlockAttachedEntity () const
 
virtual bool IsAbstractBoat () const
 
virtual bool IsAbstractChestBoat () const
 
virtual bool IsAgeableWaterCreature () const
 
virtual bool IsBoat () const
 
virtual bool IsChestBoat () const
 
virtual bool IsChestRaft () const
 
virtual bool IsRaft () const
 

Static Public Attributes

static const std::string speed_modifier_powder_snow_key = "minecraft:powder_snow"
 
static const std::string speed_modifier_sprinting_key = "minecraft:sprinting"
 

Protected Member Functions

double GetAttributeMovementSpeedValueImpl () const
 
void RemoveAttributeModifierImpl (const EntityAttribute::Type type, const EntityAttribute::ModifierKey &key)
 
void SetAttributeModifierImpl (const EntityAttribute::Type type, const EntityAttribute::ModifierKey &key, const EntityAttribute::Modifier &modifier)
 
char GetDataLivingEntityFlagsImpl () const
 
std::optional< PositionGetSleepingPosIdImpl () const
 
double GetAttributeStepHeightValueImpl () const
 
double GetAttributeGravityValueImpl () const
 
double GetAttributeJumpStrengthValueImpl () const
 
double GetAttributeWaterMovementEfficiencyValueImpl () const
 
double GetAttributeMovementEfficiencyValueImpl () const
 
- Protected Member Functions inherited from Botcraft::Entity
virtual void InitializeFaces ()
 
void OnSizeUpdated ()
 
char GetDataSharedFlagsIdImpl () const
 
bool GetDataSharedFlagsIdImpl (const EntitySharedFlagsId id) const
 
void SetDataSharedFlagsIdImpl (const char data_shared_flags_id)
 
void SetDataSharedFlagsIdImpl (const EntitySharedFlagsId id, const bool b)
 
Pose GetDataPoseImpl () const
 
void SetDataPoseImpl (const Pose data_pose)
 
AABB GetColliderImpl () const
 
virtual double GetWidthImpl () const
 
virtual double GetHeightImpl () const
 

Protected Attributes

std::map< EntityAttribute::Type, EntityAttributeattributes
 
- Protected Attributes inherited from Botcraft::Entity
std::shared_mutex entity_mutex
 
int entity_id
 
ProtocolCraft::UUID uuid
 
Vector3< double > position
 
float yaw
 
float pitch
 
Vector3< double > speed
 
bool on_ground
 
std::map< EquipmentSlot, ProtocolCraft::Slotequipments
 Items on this entity.
 
std::vector< EntityEffecteffects
 
std::map< std::string, std::any > metadata
 
std::vector< FaceDescriptorface_descriptors
 
std::vector< Renderer::Facefaces
 
bool are_rendered_faces_up_to_date
 

Static Protected Attributes

static constexpr int metadata_count = 7
 
static const std::array< std::string, metadata_countmetadata_names
 
static constexpr int hierarchy_metadata_count = Entity::metadata_count + Entity::hierarchy_metadata_count
 
- Static Protected Attributes inherited from Botcraft::Entity
static constexpr int metadata_count = 8
 
static const std::array< std::string, metadata_countmetadata_names
 
static constexpr int hierarchy_metadata_count = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from Botcraft::Entity
static std::shared_ptr< EntityCreateEntity (const EntityType type)
 

Detailed Description

Definition at line 16 of file LivingEntity.hpp.

Constructor & Destructor Documentation

◆ LivingEntity()

◆ ~LivingEntity()

Botcraft::LivingEntity::~LivingEntity ( )
virtual

Definition at line 72 of file LivingEntity.cpp.

Member Function Documentation

◆ AddAttribute()

void Botcraft::LivingEntity::AddAttribute ( const EntityAttribute attribute)

◆ ClearModifiers()

void Botcraft::LivingEntity::ClearModifiers ( const EntityAttribute::Type  type)

Definition at line 293 of file LivingEntity.cpp.

References attributes, and Botcraft::Entity::entity_mutex.

◆ GetAttribute()

std::optional< EntityAttribute > Botcraft::LivingEntity::GetAttribute ( const EntityAttribute::Type  type) const

Definition at line 256 of file LivingEntity.cpp.

References attributes, and Botcraft::Entity::entity_mutex.

◆ GetAttributeArmorToughnessValue()

double Botcraft::LivingEntity::GetAttributeArmorToughnessValue ( ) const

◆ GetAttributeArmorValue()

double Botcraft::LivingEntity::GetAttributeArmorValue ( ) const

Definition at line 339 of file LivingEntity.cpp.

References Botcraft::EntityAttribute::Armor, attributes, and Botcraft::Entity::entity_mutex.

Referenced by Serialize().

◆ GetAttributeAttackKnockbackValue()

double Botcraft::LivingEntity::GetAttributeAttackKnockbackValue ( ) const

◆ GetAttributeBurningTimeValue()

double Botcraft::LivingEntity::GetAttributeBurningTimeValue ( ) const

◆ GetAttributeExplosionKnockbackResistanceValue()

double Botcraft::LivingEntity::GetAttributeExplosionKnockbackResistanceValue ( ) const

◆ GetAttributeFallDamageMultiplierValue()

double Botcraft::LivingEntity::GetAttributeFallDamageMultiplierValue ( ) const

◆ GetAttributeGravityValue()

double Botcraft::LivingEntity::GetAttributeGravityValue ( ) const

Definition at line 377 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and GetAttributeGravityValueImpl().

Referenced by Serialize().

◆ GetAttributeGravityValueImpl()

double Botcraft::LivingEntity::GetAttributeGravityValueImpl ( ) const
protected

Definition at line 479 of file LivingEntity.cpp.

References attributes, and Botcraft::EntityAttribute::Gravity.

Referenced by GetAttributeGravityValue().

◆ GetAttributeJumpStrengthValue()

double Botcraft::LivingEntity::GetAttributeJumpStrengthValue ( ) const

◆ GetAttributeJumpStrengthValueImpl()

double Botcraft::LivingEntity::GetAttributeJumpStrengthValueImpl ( ) const
protected

Definition at line 484 of file LivingEntity.cpp.

References attributes, and Botcraft::EntityAttribute::JumpStrength.

Referenced by GetAttributeJumpStrengthValue().

◆ GetAttributeKnockbackResistanceValue()

double Botcraft::LivingEntity::GetAttributeKnockbackResistanceValue ( ) const

◆ GetAttributeMaxAbsorptionValue()

double Botcraft::LivingEntity::GetAttributeMaxAbsorptionValue ( ) const

◆ GetAttributeMaxHealthValue()

double Botcraft::LivingEntity::GetAttributeMaxHealthValue ( ) const

◆ GetAttributeMovementEfficiencyValue()

double Botcraft::LivingEntity::GetAttributeMovementEfficiencyValue ( ) const

◆ GetAttributeMovementEfficiencyValueImpl()

double Botcraft::LivingEntity::GetAttributeMovementEfficiencyValueImpl ( ) const
protected

◆ GetAttributeMovementSpeedValue()

double Botcraft::LivingEntity::GetAttributeMovementSpeedValue ( ) const

Definition at line 333 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and GetAttributeMovementSpeedValueImpl().

Referenced by Serialize().

◆ GetAttributeMovementSpeedValueImpl()

double Botcraft::LivingEntity::GetAttributeMovementSpeedValueImpl ( ) const
protected

◆ GetAttributeOxygenBonusValue()

double Botcraft::LivingEntity::GetAttributeOxygenBonusValue ( ) const

◆ GetAttributeSafeFallDistanceValue()

double Botcraft::LivingEntity::GetAttributeSafeFallDistanceValue ( ) const

◆ GetAttributeScaleValue()

double Botcraft::LivingEntity::GetAttributeScaleValue ( ) const

Definition at line 371 of file LivingEntity.cpp.

References attributes, Botcraft::Entity::entity_mutex, and Botcraft::EntityAttribute::Scale.

Referenced by Serialize().

◆ GetAttributeStepHeightValue()

double Botcraft::LivingEntity::GetAttributeStepHeightValue ( ) const

Definition at line 365 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and GetAttributeStepHeightValueImpl().

Referenced by Serialize().

◆ GetAttributeStepHeightValueImpl()

double Botcraft::LivingEntity::GetAttributeStepHeightValueImpl ( ) const
protected

Definition at line 474 of file LivingEntity.cpp.

References attributes, and Botcraft::EntityAttribute::StepHeight.

Referenced by GetAttributeStepHeightValue().

◆ GetAttributeWaterMovementEfficiencyValue()

double Botcraft::LivingEntity::GetAttributeWaterMovementEfficiencyValue ( ) const

◆ GetAttributeWaterMovementEfficiencyValueImpl()

double Botcraft::LivingEntity::GetAttributeWaterMovementEfficiencyValueImpl ( ) const
protected

◆ GetDataArrowCountId()

int Botcraft::LivingEntity::GetDataArrowCountId ( ) const

Definition at line 179 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by Serialize().

◆ GetDataEffectAmbienceId()

bool Botcraft::LivingEntity::GetDataEffectAmbienceId ( ) const

Definition at line 173 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by Serialize().

◆ GetDataEffectParticles()

std::vector< ProtocolCraft::Particle > Botcraft::LivingEntity::GetDataEffectParticles ( ) const

Definition at line 166 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by Serialize().

◆ GetDataHealthId()

float Botcraft::LivingEntity::GetDataHealthId ( ) const

◆ GetDataLivingEntityFlags()

char Botcraft::LivingEntity::GetDataLivingEntityFlags ( ) const

Definition at line 147 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and GetDataLivingEntityFlagsImpl().

Referenced by Serialize().

◆ GetDataLivingEntityFlagsImpl()

char Botcraft::LivingEntity::GetDataLivingEntityFlagsImpl ( ) const
protected

Definition at line 461 of file LivingEntity.cpp.

References Botcraft::Entity::metadata.

Referenced by GetDataLivingEntityFlags().

◆ GetDataStingerCountId()

int Botcraft::LivingEntity::GetDataStingerCountId ( ) const

Definition at line 186 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by Serialize().

◆ GetSleepingPosId()

std::optional< Position > Botcraft::LivingEntity::GetSleepingPosId ( ) const

Definition at line 194 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and GetSleepingPosIdImpl().

Referenced by Serialize().

◆ GetSleepingPosIdImpl()

std::optional< Position > Botcraft::LivingEntity::GetSleepingPosIdImpl ( ) const
protected

Definition at line 467 of file LivingEntity.cpp.

References Botcraft::Entity::metadata.

Referenced by GetSleepingPosId().

◆ IsLivingEntity()

bool Botcraft::LivingEntity::IsLivingEntity ( ) const
overridevirtual

Reimplemented from Botcraft::Entity.

Definition at line 77 of file LivingEntity.cpp.

◆ RemoveAttributeModifier()

void Botcraft::LivingEntity::RemoveAttributeModifier ( const EntityAttribute::Type  type,
const EntityAttribute::ModifierKey key 
)

◆ RemoveAttributeModifierImpl()

void Botcraft::LivingEntity::RemoveAttributeModifierImpl ( const EntityAttribute::Type  type,
const EntityAttribute::ModifierKey key 
)
protected

Definition at line 440 of file LivingEntity.cpp.

References attributes.

Referenced by RemoveAttributeModifier().

◆ Serialize()

ProtocolCraft::Json::Value Botcraft::LivingEntity::Serialize ( ) const
overridevirtual

Reimplemented from Botcraft::Entity.

Reimplemented in Botcraft::AgeableMobEntity, Botcraft::BatEntity, Botcraft::AbstractFishEntity, Botcraft::AllayEntity, Botcraft::AnimalEntity, Botcraft::ArmadilloEntity, Botcraft::AxolotlEntity, Botcraft::BeeEntity, Botcraft::CamelEntity, Botcraft::CatEntity, Botcraft::DolphinEntity, Botcraft::FoxEntity, Botcraft::FrogEntity, Botcraft::GoatEntity, Botcraft::AbstractChestedHorseEntity, Botcraft::AbstractHorseEntity, Botcraft::HorseEntity, Botcraft::LlamaEntity, Botcraft::IronGolemEntity, Botcraft::MushroomCowEntity, Botcraft::OcelotEntity, Botcraft::PandaEntity, Botcraft::ParrotEntity, Botcraft::PigEntity, Botcraft::PolarBearEntity, Botcraft::PufferfishEntity, Botcraft::RabbitEntity, Botcraft::SalmonEntity, Botcraft::SheepEntity, Botcraft::SnifferEntity, Botcraft::SnowGolemEntity, Botcraft::TropicalFishEntity, Botcraft::TurtleEntity, Botcraft::WolfEntity, Botcraft::EnderDragonEntity, Botcraft::WitherBossEntity, Botcraft::ArmorStandEntity, Botcraft::GlowSquidEntity, Botcraft::MobEntity, Botcraft::BlazeEntity, Botcraft::BoggedEntity, Botcraft::CreakingEntity, Botcraft::CreeperEntity, Botcraft::EnderManEntity, Botcraft::GhastEntity, Botcraft::GuardianEntity, Botcraft::HoglinEntity, Botcraft::MonsterEntity, Botcraft::PhantomEntity, Botcraft::AbstractPiglinEntity, Botcraft::PiglinEntity, Botcraft::PillagerEntity, Botcraft::ShulkerEntity, Botcraft::SkeletonEntity, Botcraft::SlimeEntity, Botcraft::SpellcasterIllagerEntity, Botcraft::SpiderEntity, Botcraft::StriderEntity, Botcraft::VexEntity, Botcraft::WardenEntity, Botcraft::WitchEntity, Botcraft::ZoglinEntity, Botcraft::ZombieEntity, Botcraft::ZombieVillagerEntity, Botcraft::AbstractVillagerEntity, Botcraft::VillagerEntity, Botcraft::PlayerEntity, Botcraft::RaiderEntity, and Botcraft::TamableAnimalEntity.

Definition at line 83 of file LivingEntity.cpp.

References GetAttributeArmorToughnessValue(), GetAttributeArmorValue(), GetAttributeAttackKnockbackValue(), GetAttributeBurningTimeValue(), GetAttributeExplosionKnockbackResistanceValue(), GetAttributeFallDamageMultiplierValue(), GetAttributeGravityValue(), GetAttributeJumpStrengthValue(), GetAttributeKnockbackResistanceValue(), GetAttributeMaxAbsorptionValue(), GetAttributeMaxHealthValue(), GetAttributeMovementEfficiencyValue(), GetAttributeMovementSpeedValue(), GetAttributeOxygenBonusValue(), GetAttributeSafeFallDistanceValue(), GetAttributeScaleValue(), GetAttributeStepHeightValue(), GetAttributeWaterMovementEfficiencyValue(), GetDataArrowCountId(), GetDataEffectAmbienceId(), GetDataEffectParticles(), GetDataHealthId(), GetDataLivingEntityFlags(), GetDataStingerCountId(), GetSleepingPosId(), and Botcraft::Entity::Serialize().

Referenced by Botcraft::ArmorStandEntity::Serialize(), Botcraft::MobEntity::Serialize(), and Botcraft::PlayerEntity::Serialize().

◆ SetAttributeBaseValue()

void Botcraft::LivingEntity::SetAttributeBaseValue ( const EntityAttribute::Type  type,
const double  value 
)

◆ SetAttributeModifier()

void Botcraft::LivingEntity::SetAttributeModifier ( const EntityAttribute::Type  type,
const EntityAttribute::ModifierKey key,
const EntityAttribute::Modifier modifier 
)

Definition at line 287 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and SetAttributeModifierImpl().

◆ SetAttributeModifierImpl()

void Botcraft::LivingEntity::SetAttributeModifierImpl ( const EntityAttribute::Type  type,
const EntityAttribute::ModifierKey key,
const EntityAttribute::Modifier modifier 
)
protected

Definition at line 450 of file LivingEntity.cpp.

References attributes, Botcraft::Entity::GetName(), and LOG_WARNING.

Referenced by SetAttributeModifier().

◆ SetDataArrowCountId()

void Botcraft::LivingEntity::SetDataArrowCountId ( const int  data_arrow_count_id)

Definition at line 234 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by LivingEntity().

◆ SetDataEffectAmbienceId()

void Botcraft::LivingEntity::SetDataEffectAmbienceId ( const bool  data_effect_ambience_id)

Definition at line 228 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by LivingEntity().

◆ SetDataEffectParticles()

void Botcraft::LivingEntity::SetDataEffectParticles ( const std::vector< ProtocolCraft::Particle > &  data_effect_particles)

Definition at line 221 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by LivingEntity().

◆ SetDataHealthId()

void Botcraft::LivingEntity::SetDataHealthId ( const float  data_health_id)

◆ SetDataLivingEntityFlags()

void Botcraft::LivingEntity::SetDataLivingEntityFlags ( const char  data_living_entity_flags)

Definition at line 202 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by LivingEntity().

◆ SetDataStingerCountId()

void Botcraft::LivingEntity::SetDataStingerCountId ( const int  data_stinger_count_id)

Definition at line 241 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by LivingEntity().

◆ SetMetadataValue()

void Botcraft::LivingEntity::SetMetadataValue ( const int  index,
const std::any &  value 
)
overridevirtual

Reimplemented from Botcraft::Entity.

Reimplemented in Botcraft::AgeableMobEntity, Botcraft::BatEntity, Botcraft::AbstractFishEntity, Botcraft::AllayEntity, Botcraft::ArmadilloEntity, Botcraft::AxolotlEntity, Botcraft::BeeEntity, Botcraft::CamelEntity, Botcraft::CatEntity, Botcraft::DolphinEntity, Botcraft::FoxEntity, Botcraft::FrogEntity, Botcraft::GoatEntity, Botcraft::AbstractChestedHorseEntity, Botcraft::AbstractHorseEntity, Botcraft::HorseEntity, Botcraft::LlamaEntity, Botcraft::IronGolemEntity, Botcraft::MushroomCowEntity, Botcraft::OcelotEntity, Botcraft::PandaEntity, Botcraft::ParrotEntity, Botcraft::PigEntity, Botcraft::PolarBearEntity, Botcraft::PufferfishEntity, Botcraft::RabbitEntity, Botcraft::SalmonEntity, Botcraft::SheepEntity, Botcraft::SnifferEntity, Botcraft::SnowGolemEntity, Botcraft::TropicalFishEntity, Botcraft::TurtleEntity, Botcraft::WolfEntity, Botcraft::EnderDragonEntity, Botcraft::WitherBossEntity, Botcraft::ArmorStandEntity, Botcraft::GlowSquidEntity, Botcraft::MobEntity, Botcraft::BlazeEntity, Botcraft::BoggedEntity, Botcraft::CreakingEntity, Botcraft::CreeperEntity, Botcraft::EnderManEntity, Botcraft::GhastEntity, Botcraft::GuardianEntity, Botcraft::HoglinEntity, Botcraft::PhantomEntity, Botcraft::AbstractPiglinEntity, Botcraft::PiglinEntity, Botcraft::PillagerEntity, Botcraft::ShulkerEntity, Botcraft::SkeletonEntity, Botcraft::SlimeEntity, Botcraft::SpellcasterIllagerEntity, Botcraft::SpiderEntity, Botcraft::StriderEntity, Botcraft::VexEntity, Botcraft::WardenEntity, Botcraft::WitchEntity, Botcraft::ZoglinEntity, Botcraft::ZombieEntity, Botcraft::ZombieVillagerEntity, Botcraft::AbstractVillagerEntity, Botcraft::VillagerEntity, Botcraft::PlayerEntity, Botcraft::RaiderEntity, and Botcraft::TamableAnimalEntity.

Definition at line 134 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, hierarchy_metadata_count, Botcraft::Entity::metadata, metadata_count, metadata_names, and Botcraft::Entity::SetMetadataValue().

Referenced by Botcraft::ArmorStandEntity::SetMetadataValue(), Botcraft::MobEntity::SetMetadataValue(), and Botcraft::PlayerEntity::SetMetadataValue().

◆ SetSleepingPosId()

void Botcraft::LivingEntity::SetSleepingPosId ( const std::optional< Position > &  sleeping_pos_id)

Definition at line 249 of file LivingEntity.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::metadata.

Referenced by LivingEntity().

Member Data Documentation

◆ attributes

std::map<EntityAttribute::Type, EntityAttribute> Botcraft::LivingEntity::attributes
protected

Definition at line 137 of file LivingEntity.hpp.

Referenced by Botcraft::AbstractChestedHorseEntity::AbstractChestedHorseEntity(), Botcraft::AbstractFishEntity::AbstractFishEntity(), Botcraft::AbstractHorseEntity::AbstractHorseEntity(), Botcraft::AbstractSkeletonEntity::AbstractSkeletonEntity(), AddAttribute(), Botcraft::AllayEntity::AllayEntity(), Botcraft::AnimalEntity::AnimalEntity(), Botcraft::ArmadilloEntity::ArmadilloEntity(), Botcraft::ArmorStandEntity::ArmorStandEntity(), Botcraft::AxolotlEntity::AxolotlEntity(), Botcraft::BatEntity::BatEntity(), Botcraft::BeeEntity::BeeEntity(), Botcraft::BlazeEntity::BlazeEntity(), Botcraft::BoggedEntity::BoggedEntity(), Botcraft::BreezeEntity::BreezeEntity(), Botcraft::CamelEntity::CamelEntity(), Botcraft::CatEntity::CatEntity(), Botcraft::CaveSpiderEntity::CaveSpiderEntity(), Botcraft::ChickenEntity::ChickenEntity(), ClearModifiers(), Botcraft::CowEntity::CowEntity(), Botcraft::CreakingEntity::CreakingEntity(), Botcraft::CreeperEntity::CreeperEntity(), Botcraft::DolphinEntity::DolphinEntity(), Botcraft::DrownedEntity::DrownedEntity(), Botcraft::ElderGuardianEntity::ElderGuardianEntity(), Botcraft::EnderDragonEntity::EnderDragonEntity(), Botcraft::EnderManEntity::EnderManEntity(), Botcraft::EndermiteEntity::EndermiteEntity(), Botcraft::EvokerEntity::EvokerEntity(), Botcraft::FoxEntity::FoxEntity(), Botcraft::FrogEntity::FrogEntity(), GetAttribute(), GetAttributeArmorToughnessValue(), GetAttributeArmorValue(), Botcraft::AllayEntity::GetAttributeAttackDamageValue(), Botcraft::AxolotlEntity::GetAttributeAttackDamageValue(), Botcraft::BeeEntity::GetAttributeAttackDamageValue(), Botcraft::CatEntity::GetAttributeAttackDamageValue(), Botcraft::DolphinEntity::GetAttributeAttackDamageValue(), Botcraft::FoxEntity::GetAttributeAttackDamageValue(), Botcraft::FrogEntity::GetAttributeAttackDamageValue(), Botcraft::GoatEntity::GetAttributeAttackDamageValue(), Botcraft::IronGolemEntity::GetAttributeAttackDamageValue(), Botcraft::OcelotEntity::GetAttributeAttackDamageValue(), Botcraft::PandaEntity::GetAttributeAttackDamageValue(), Botcraft::ParrotEntity::GetAttributeAttackDamageValue(), Botcraft::PolarBearEntity::GetAttributeAttackDamageValue(), Botcraft::RabbitEntity::GetAttributeAttackDamageValue(), Botcraft::WolfEntity::GetAttributeAttackDamageValue(), Botcraft::HoglinEntity::GetAttributeAttackDamageValue(), Botcraft::MonsterEntity::GetAttributeAttackDamageValue(), Botcraft::PlayerEntity::GetAttributeAttackDamageValue(), GetAttributeAttackKnockbackValue(), Botcraft::PlayerEntity::GetAttributeAttackSpeedValue(), GetAttributeBurningTimeValue(), GetAttributeExplosionKnockbackResistanceValue(), GetAttributeFallDamageMultiplierValue(), Botcraft::AllayEntity::GetAttributeFlyingSpeedValue(), Botcraft::BeeEntity::GetAttributeFlyingSpeedValue(), Botcraft::ParrotEntity::GetAttributeFlyingSpeedValue(), Botcraft::WitherBossEntity::GetAttributeFlyingSpeedValue(), Botcraft::MobEntity::GetAttributeFollowRangeValue(), GetAttributeGravityValueImpl(), GetAttributeJumpStrengthValueImpl(), GetAttributeKnockbackResistanceValue(), Botcraft::PlayerEntity::GetAttributeLuckValue(), GetAttributeMaxAbsorptionValue(), GetAttributeMaxHealthValue(), GetAttributeMovementEfficiencyValueImpl(), GetAttributeMovementSpeedValueImpl(), GetAttributeOxygenBonusValue(), Botcraft::PlayerEntity::GetAttributePlayerBlockBreakSpeedValue(), Botcraft::PlayerEntity::GetAttributePlayerBlockInteractionRangeValue(), Botcraft::PlayerEntity::GetAttributePlayerEntityInteractionRangeValue(), Botcraft::PlayerEntity::GetAttributePlayerMiningEfficiencyValue(), Botcraft::PlayerEntity::GetAttributePlayerSneakingSpeedValueImpl(), Botcraft::PlayerEntity::GetAttributePlayerSubmergedMiningSpeedValue(), Botcraft::PlayerEntity::GetAttributePlayerSweepingDamageRatioValue(), GetAttributeSafeFallDistanceValue(), GetAttributeScaleValue(), Botcraft::ZombieEntity::GetAttributeSpawnReinforcementsChanceValue(), GetAttributeStepHeightValueImpl(), Botcraft::AnimalEntity::GetAttributeTemptRangeValue(), GetAttributeWaterMovementEfficiencyValueImpl(), Botcraft::GhastEntity::GhastEntity(), Botcraft::GiantEntity::GiantEntity(), Botcraft::GoatEntity::GoatEntity(), Botcraft::GuardianEntity::GuardianEntity(), Botcraft::HoglinEntity::HoglinEntity(), Botcraft::IllusionerEntity::IllusionerEntity(), Botcraft::IronGolemEntity::IronGolemEntity(), LivingEntity(), Botcraft::LlamaEntity::LlamaEntity(), Botcraft::MagmaCubeEntity::MagmaCubeEntity(), Botcraft::MobEntity::MobEntity(), Botcraft::MonsterEntity::MonsterEntity(), Botcraft::OcelotEntity::OcelotEntity(), Botcraft::PandaEntity::PandaEntity(), Botcraft::ParrotEntity::ParrotEntity(), Botcraft::PigEntity::PigEntity(), Botcraft::PiglinBruteEntity::PiglinBruteEntity(), Botcraft::PiglinEntity::PiglinEntity(), Botcraft::PillagerEntity::PillagerEntity(), Botcraft::PlayerEntity::PlayerEntity(), Botcraft::PolarBearEntity::PolarBearEntity(), Botcraft::RabbitEntity::RabbitEntity(), Botcraft::RavagerEntity::RavagerEntity(), RemoveAttributeModifierImpl(), SetAttributeBaseValue(), SetAttributeModifierImpl(), Botcraft::SheepEntity::SheepEntity(), Botcraft::ShulkerEntity::ShulkerEntity(), Botcraft::SilverfishEntity::SilverfishEntity(), Botcraft::SlimeEntity::SizeChanged(), Botcraft::SkeletonHorseEntity::SkeletonHorseEntity(), Botcraft::SlimeEntity::SlimeEntity(), Botcraft::SnifferEntity::SnifferEntity(), Botcraft::SnowGolemEntity::SnowGolemEntity(), Botcraft::SpiderEntity::SpiderEntity(), Botcraft::SquidEntity::SquidEntity(), Botcraft::StriderEntity::StriderEntity(), Botcraft::TadpoleEntity::TadpoleEntity(), Botcraft::TurtleEntity::TurtleEntity(), Botcraft::VexEntity::VexEntity(), Botcraft::VillagerEntity::VillagerEntity(), Botcraft::VindicatorEntity::VindicatorEntity(), Botcraft::WardenEntity::WardenEntity(), Botcraft::WitchEntity::WitchEntity(), Botcraft::WitherBossEntity::WitherBossEntity(), Botcraft::WolfEntity::WolfEntity(), Botcraft::ZoglinEntity::ZoglinEntity(), Botcraft::ZombieEntity::ZombieEntity(), Botcraft::ZombieHorseEntity::ZombieHorseEntity(), and Botcraft::ZombifiedPiglinEntity::ZombifiedPiglinEntity().

◆ hierarchy_metadata_count

constexpr int Botcraft::LivingEntity::hierarchy_metadata_count = Entity::metadata_count + Entity::hierarchy_metadata_count
staticconstexprprotected

Definition at line 27 of file LivingEntity.hpp.

Referenced by SetMetadataValue().

◆ metadata_count

constexpr int Botcraft::LivingEntity::metadata_count = 7
staticconstexprprotected

Definition at line 20 of file LivingEntity.hpp.

Referenced by SetMetadataValue().

◆ metadata_names

const std::array< std::string, LivingEntity::metadata_count > Botcraft::LivingEntity::metadata_names
staticprotected
Initial value:
{ {
"data_living_entity_flags",
"data_health_id",
"data_effect_particles",
"data_effect_ambience_id",
"data_arrow_count_id",
"data_stinger_count_id",
"sleeping_pos_id",
} }

Definition at line 26 of file LivingEntity.hpp.

Referenced by SetMetadataValue().

◆ speed_modifier_powder_snow_key

const std::string Botcraft::LivingEntity::speed_modifier_powder_snow_key = "minecraft:powder_snow"
inlinestatic

Definition at line 114 of file LivingEntity.hpp.

◆ speed_modifier_sprinting_key

const std::string Botcraft::LivingEntity::speed_modifier_sprinting_key = "minecraft:sprinting"
inlinestatic

Definition at line 115 of file LivingEntity.hpp.

Referenced by Botcraft::PhysicsManager::SetSprinting().


The documentation for this class was generated from the following files: