BlockPlaceEvent
Extends Event
Implements Cancellable
Called when a player initiates a block placement action. More than one block may be changed by a single placement action, for example when placing a door.
Properties
$blockAgainst
php
public \pocketmine\block\Block $blockAgainst$item
php
public \pocketmine\item\Item $item$player
php
public \pocketmine\player\Player $player$transaction
php
public \pocketmine\world\BlockTransaction $transactionMethods
__construct()
php
public function __construct(\pocketmine\player\Player $player, \pocketmine\world\BlockTransaction $transaction, \pocketmine\block\Block $blockAgainst, \pocketmine\item\Item $item)getBlockAgainst()
php
public function getBlockAgainst() : \pocketmine\block\BlockgetItem()
php
public function getItem() : \pocketmine\item\ItemGets the item in hand
getPlayer()
php
public function getPlayer() : \pocketmine\player\PlayerReturns the player who is placing the block.
getTransaction()
php
public function getTransaction() : \pocketmine\world\BlockTransactionReturns a BlockTransaction object containing all the block positions that will be changed by this event, and the states they will be changed to.
This will usually contain only one block, but may contain more if the block being placed is a multi-block structure such as a door or bed.
