Class endstone::ActorChangeBlockEvent¶
ClassList > endstone > ActorChangeBlockEvent
Called when an Actor changes a block as part of its own behaviour, such as a creeper exploding, an enderman picking a block up, a ravager trampling crops or a zombie breaking a door.More...
#include <endstone/event/actor/actor_change_block_event.h>
Inherits the following classes: endstone::Cancellable
Public Functions¶
| Type | Name |
|---|---|
| ActorChangeBlockEvent (const NotNull< Actor > & actor, const NotNull< Block > & block) |
|
| ENDSTONE_EVENT (ActorChangeBlockEvent) |
|
| const NotNull< Block > & | getBlock () const Gets the block that will be destroyed or changed. |
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¶
Unlike Bukkit's equivalent, this covers only the mob griefing paths. It is not called for falling blocks landing or for sheep eating grass, and the resulting block state is not available. Blocks broken by a player are covered by BlockBreakEvent.
Public Functions Documentation¶
function ActorChangeBlockEvent¶
inline explicit endstone::ActorChangeBlockEvent::ActorChangeBlockEvent (
const NotNull < Actor > & actor,
const NotNull < Block > & block
)
function ENDSTONE_EVENT¶
function getBlock¶
Gets the block that will be destroyed or changed.
Returns:
the affected block
The documentation for this class was generated from the following file include/endstone/event/actor/actor_change_block_event.h