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
14public:
15 constexpr explicit ActorHurtEvent(Actor& actor, ActorDamageSource const& source, float& damage)
16 : Cancellable(actor),
17 mSource(source),
18 mDamage(damage) {}
19
20 LLAPI void serialize(CompoundTag&) const override;
21 LLAPI void deserialize(CompoundTag const&) override;
22
23 LLNDAPI ActorDamageSource const& source() const;
24 LLNDAPI float& damage() const;
25};
26} // namespace ll::event::inline entity
Definition ActorDamageSource.h:18
Definition Actor.h:106
Definition CompoundTag.h:23