Skip to content

Class endstone::BlockFormEvent

ClassList > endstone > BlockFormEvent

Called when a block is formed or spreads based on world conditions. More...

  • #include <endstone/event/block/block_form_event.h>

Inherits the following classes: endstone::BlockGrowEvent

Public Functions

Type Name
BlockGrowEvent (std::unique_ptr< Block > block, std::unique_ptr< BlockState > new_state)
ENDSTONE_EVENT (BlockFormEvent)

Public Functions inherited from endstone::BlockGrowEvent

See endstone::BlockGrowEvent

Type Name
BlockGrowEvent (std::unique_ptr< Block > block, std::unique_ptr< BlockState > new_state)
ENDSTONE_EVENT (BlockGrowEvent)
BlockState & getNewState () const
Gets the state of the block where it will form or spread to.

Public Functions inherited from endstone::Cancellable

See endstone::Cancellable

Type Name
virtual void cancel ()
Cancel this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
virtual bool isCancelled () override const
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
virtual void setCancelled (bool cancel) override
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Public Functions inherited from endstone::ICancellable

See endstone::ICancellable

Type Name
virtual void cancel () = 0
virtual bool isCancelled () const = 0
virtual void setCancelled (bool cancel) = 0
virtual ~ICancellable () = default

Detailed Description

Use BlockSpreadEvent to catch blocks that actually spread and don't just "randomly" form.

Examples: * Snow forming due to a snow storm. * Ice forming in a snowy Biome like Taiga or Tundra. * Obsidian / Cobblestone forming due to contact with water. * Concrete forming due to mixing of concrete powder and water.

If a Block Form event is cancelled, the block will not be formed.

Public Functions Documentation

function BlockGrowEvent

inline explicit endstone::BlockFormEvent::BlockGrowEvent (
    std::unique_ptr< Block > block,
    std::unique_ptr< BlockState > new_state
) 

function ENDSTONE_EVENT

endstone::BlockFormEvent::ENDSTONE_EVENT (
    BlockFormEvent
) 


The documentation for this class was generated from the following file include/endstone/event/block/block_form_event.h