Botcraft 26.3
Loading...
Searching...
No Matches
AbstractIllagerEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
6 {
7 // Initialize all metadata with default values
9#if PROTOCOL_VERSION < 405 /* < 1.14 */
10 SetHasTarget(0);
11#endif
12 }
13
18
20 {
21 return true;
22 }
23
24
25#if PROTOCOL_VERSION < 405 /* < 1.14 */
27 {
29
30 output["metadata"]["has_target"] = GetHasTarget();
31
32 return output;
33 }
34
35
36 char AbstractIllagerEntity::GetHasTarget() const
37 {
38 return GetMetadata<char>(BOTCRAFT_ENTITY_METADATA_INDEX("has_target"));
39 }
40
41 void AbstractIllagerEntity::SetHasTarget(const char has_target)
42 {
43 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("has_target"), has_target);
44 }
45#endif
46
47}
virtual bool IsAbstractIllager() const override
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
virtual ProtocolCraft::Json::Value Serialize() const
Definition Entity.cpp:1246
std::vector< std::any > metadata
Definition Entity.hpp:335
virtual ProtocolCraft::Json::Value Serialize() const override
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