BlockBreakEvent
Extends BlockEvent
Implements Cancellable
Called when a player destroys a block somewhere in the world.
Properties
$blockDrops protected
php
protected array $blockDrops$instaBreak
php
public bool $instaBreak$item
php
public \pocketmine\item\Item $item$player
php
public \pocketmine\player\Player $player$xpDrops
php
public int $xpDropsMethods
__construct()
php
public function __construct(\pocketmine\player\Player $player, \pocketmine\block\Block $block, \pocketmine\item\Item $item, bool $instaBreak = false, array $drops = [], int $xpDrops = 0)getDrops()
php
public function getDrops() : arraygetInstaBreak()
php
public function getInstaBreak() : boolReturns whether the block may be broken in less than the amount of time calculated. This is usually true for creative players.
getItem()
php
public function getItem() : \pocketmine\item\ItemReturns the item used to destroy the block.
getPlayer()
php
public function getPlayer() : \pocketmine\player\PlayerReturns the player who is destroying the block.
getXpDropAmount()
php
public function getXpDropAmount() : intReturns how much XP will be dropped by breaking this block.
setDrops()
php
public function setDrops(array $drops) : voidsetDropsVariadic()
php
public function setDropsVariadic(\pocketmine\item\Item ...$drops) : voidVariadic hack for easy array member type enforcement.
setInstaBreak()
php
public function setInstaBreak(bool $instaBreak) : voidsetXpDropAmount()
php
public function setXpDropAmount(int $amount) : voidSets how much XP will be dropped by breaking this block.
