LeviLamina
Loading...
Searching...
No Matches
ActorHurtEvent.h
1#pragma once
2
3#include "ll/api/event/Cancellable.h"
4#include "ll/api/event/entity/ActorEvent.h"
5
6#include "mc/world/actor/ActorDamageSource.h"
7
8namespace ll::event::inline entity {
9
10class ActorHurtEvent final : public Cancellable<ActorEvent> {
11 ActorDamageSource const& mSource;
12 float& mDamage;
13 bool& mKnock;
14 bool& mIgnite;
15
16public:
17 constexpr explicit ActorHurtEvent(
18 Actor& actor,
19 ActorDamageSource const& source,
20 float& damage,
21 bool& knock,
22 bool& ignite
23 )
24 : Cancellable(actor),
25 mSource(source),
26 mDamage(damage),
27 mKnock(knock),
28 mIgnite(ignite) {}
29
30 LLAPI void serialize(CompoundTag&) const override;
31 LLAPI void deserialize(CompoundTag const&) override;
32
33 LLNDAPI ActorDamageSource const& source() const;
34 LLNDAPI float& damage() const;
35 LLNDAPI bool& knock() const;
36 LLNDAPI bool& ignite() const;
37};
38} // namespace ll::event::inline entity
Definition ActorDamageSource.h:18
Definition Actor.h:104
Definition CompoundTag.h:13
Definition ActorHurtEvent.h:10
Definition serialize.h:11