MCPcopy Create free account
hub / github.com/EndstoneMC/endstone / init_damage

Function init_damage

src/endstone/python/damage.cpp:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace endstone::python {
20
21void init_damage(py::module &m)
22{
23 py::class_<DamageSource>(m, "DamageSource", "Represents a source of damage.")
24 .def_property_readonly("type", &DamageSource::getType, "Get the damage type.")
25 .def_property_readonly("actor", &DamageSource::getActor, py::return_value_policy::reference,
26 "Get the actor that caused the damage to occur.")
27 .def_property_readonly("damaging_actor", &DamageSource::getDamagingActor, py::return_value_policy::reference,
28 "Get the actor that directly caused the damage.")
29 .def_property_readonly("is_indirect", &DamageSource::isIndirect, "Get if this damage is indirect.")
30 .def("__str__", [](const DamageSource &self) { return fmt::format("{}", self); });
31}
32
33} // namespace endstone::python

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected