Class endstone::CauldronLevelChangeEvent¶
ClassList > endstone > CauldronLevelChangeEvent
Called when a cauldron's level or contents change. More...
#include <endstone/event/block/cauldron_level_change_event.h>
Inherits the following classes: endstone::Cancellable
Public Types¶
| Type | Name |
|---|---|
| enum | ChangeReason Describes what caused the cauldron to change. |
Public Functions¶
| Type | Name |
|---|---|
| CauldronLevelChangeEvent (const NotNull< Block > & block, const Nullable< Actor > & actor, ChangeReason reason, const NotNull< BlockState > & new_state) |
|
| ENDSTONE_EVENT (CauldronLevelChangeEvent) |
|
| const Nullable< Actor > & | getActor () const Gets the actor which did this. |
| const NotNull< BlockState > & | getNewState () const Gets the state the cauldron will take. |
| ChangeReason | getReason () const Gets the reason for the change. |
Public Functions inherited from endstone::Cancellable¶
| Type | Name |
|---|---|
| virtual void | cancel () Cancel this event. |
| virtual bool | isCancelled () override const Gets the cancellation state of this event. |
| virtual void | setCancelled (bool cancel) override Sets the cancellation state of this event. |
Public Functions inherited from endstone::ICancellable¶
| Type | Name |
|---|---|
| virtual void | cancel () = 0 Cancels this event. |
| virtual bool | isCancelled () const = 0 Gets the cancellation state of this event. |
| virtual void | setCancelled (bool cancel) = 0 Sets the cancellation state of this event. |
| virtual | ~ICancellable () = default |
Detailed Description¶
If this event is cancelled, the cauldron will not change.
Public Types Documentation¶
enum ChangeReason¶
Describes what caused the cauldron to change.
enum endstone::CauldronLevelChangeEvent::ChangeReason {
BucketFill,
BucketEmpty,
BottleFill,
BottleEmpty,
BannerWash,
ArmorWash,
ShulkerWash,
Extinguish,
Evaporate,
NaturalFill,
Unknown
};
Public Functions Documentation¶
function CauldronLevelChangeEvent¶
inline endstone::CauldronLevelChangeEvent::CauldronLevelChangeEvent (
const NotNull < Block > & block,
const Nullable < Actor > & actor,
ChangeReason reason,
const NotNull < BlockState > & new_state
)
function ENDSTONE_EVENT¶
function getActor¶
Gets the actor which did this.
Only a player interacting with the cauldron is reported. Every other change reports nullptr.
Returns:
the actor which did this, or nullptr if there is none
function getNewState¶
Gets the state the cauldron will take.
Modifying the returned state changes what the cauldron becomes.
Returns:
the new state of the cauldron
function getReason¶
Gets the reason for the change.
Only a player interacting with the cauldron is attributed. Every other change reports ChangeReason::Unknown.
Returns:
the reason for the change
The documentation for this class was generated from the following file include/endstone/event/block/cauldron_level_change_event.h