Botcraft 26.3
Loading...
Searching...
No Matches
WitchEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
6 {
7 // Initialize all metadata with default values
9 SetDataUsingItem(false);
10
11 // Initialize all attributes with default values
14 }
15
20
21
22 std::string WitchEntity::GetName() const
23 {
24 return "witch";
25 }
26
31
32
34 {
35 return "witch";
36 }
37
42
43
45 {
46#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
48#else
50#endif
51
52 output["metadata"]["data_using_item"] = GetDataUsingItem();
53
54 return output;
55 }
56
57
59 {
60 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_using_item"));
61 }
62
63
64 void WitchEntity::SetDataUsingItem(const bool data_using_item)
65 {
66 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_using_item"), data_using_item);
67 }
68
69
71 {
72 return 0.6;
73 }
74
76 {
77 return 1.95;
78 }
79
80}
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
std::vector< std::any > metadata
Definition Entity.hpp:335
std::map< EntityAttribute::Type, EntityAttribute > attributes
virtual ProtocolCraft::Json::Value Serialize() const override
Definition MobEntity.cpp:29
virtual ProtocolCraft::Json::Value Serialize() const override
virtual std::string GetName() const override
static constexpr int metadata_count
bool GetDataUsingItem() const
static constexpr int hierarchy_metadata_count
void SetDataUsingItem(const bool data_using_item)
static std::string GetClassName()
virtual double GetWidthImpl() const override
virtual ProtocolCraft::Json::Value Serialize() const override
virtual double GetHeightImpl() const override
virtual EntityType GetType() const override
static EntityType GetClassType()
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45
#define BOTCRAFT_ENTITY_METADATA_INDEX(name)
Definition Entity.hpp:347