Botcraft 26.3
Loading...
Searching...
No Matches
AbstractVillagerEntity.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 477 /* > 1.14 */
3
4namespace Botcraft
5{
7 {
8 // Initialize all metadata with default values
11 }
12
17
19 {
20 return true;
21 }
22
23
25 {
27
28 output["metadata"]["data_unhappy_counter"] = GetDataUnhappyCounter();
29
30 return output;
31 }
32
33
35 {
36 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_unhappy_counter"));
37 }
38
39
40 void AbstractVillagerEntity::SetDataUnhappyCounter(const int data_unhappy_counter)
41 {
42 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_unhappy_counter"), data_unhappy_counter);
43 }
44
45}
46#endif
virtual ProtocolCraft::Json::Value Serialize() const override
void SetDataUnhappyCounter(const int data_unhappy_counter)
virtual bool IsAbstractVillager() const override
virtual ProtocolCraft::Json::Value Serialize() const override
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
std::vector< std::any > metadata
Definition Entity.hpp:335
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