endstone::BlockPlaceEvent
Called when a block is placed by a player.
Bases: endstone::Cancellable< BlockEvent >
Attributes:
Name | Description |
---|---|
NAME |
Functions:
Name | Description |
---|---|
BlockPlaceEvent | |
getBlockAgainst | Gets the block that this block was placed against. |
getBlockPlacedState | Gets the BlockState for the block which was placed. |
getBlockReplaced | Gets the block which was replaced. |
getEventName | |
getPlayer | Gets the player who placed the block involved in this event. |
NAME
const std::string endstone::BlockPlaceEvent::NAME;
BlockPlaceEvent
BlockPlaceEvent(std::unique_ptr<BlockState> placed_block,
std::unique_ptr<Block> replaced_block,
std::unique_ptr<Block> placed_against, Player &player)
getBlockAgainst
Block &getBlockAgainst() const
Gets the block that this block was placed against.
Returns:
Block the block that the new block was placed against
getBlockPlacedState
BlockState &getBlockPlacedState() const
Gets the BlockState for the block which was placed.
Returns:
The BlockState for the block which was placed.
getBlockReplaced
Block &getBlockReplaced() const
Gets the block which was replaced.
Returns:
The Block which was replaced.
getEventName
std::string getEventName() override const
Gets a user-friendly identifier for this event.
Returns:
name of this event
getPlayer
Player &getPlayer() const
Gets the player who placed the block involved in this event.
Returns:
The Player who placed the block involved in this event
Last updated on