Skip to content

BrushableBlock 5.46.0 ​

class · pocketmine\block\tile\BrushableBlock · source

Extends Spawnable

Block entity of suspicious sand and gravel ("BrushableBlock" in vanilla). Holds either a loot table that is rolled the first time the block is brushed, or the item that was already rolled, plus the brushing progress.

Constants ​

TAG_BRUSH_COUNT ​

php
public const TAG_BRUSH_COUNT = "brush_count"

TAG_BRUSH_DIRECTION ​

php
public const TAG_BRUSH_DIRECTION = "brush_direction"

TAG_ITEM ​

php
public const TAG_ITEM = "item"

TAG_LOOT_TABLE ​

php
public const TAG_LOOT_TABLE = "LootTable"

TAG_LOOT_TABLE_SEED ​

php
public const TAG_LOOT_TABLE_SEED = "LootTableSeed"

TAG_LOOT_TABLE_SEED_LONG ​

php
public const TAG_LOOT_TABLE_SEED_LONG = "LootTableSeedLong"

the full Java seed (LootTableSeed only holds its low 32 bits, the type Bedrock uses)

TAG_TYPE ​

php
public const TAG_TYPE = "type"

Properties ​

$brushCountResetsAtTick ​

php
public int $brushCountResetsAtTick

server tick at which unfinished brushing starts to decay (not saved)

$cooldownEndsAtTick ​

php
public int $cooldownEndsAtTick

server tick before which brushing does nothing (not saved)

Methods ​

addAdditionalSpawnData() protected ​

php
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

getBrushCount() ​

php
public function getBrushCount() : int

getBrushDirection() ​

php
public function getBrushDirection() : int

getItem() ​

php
public function getItem() : ?\pocketmine\item\Item

getLootTable() ​

php
public function getLootTable() : ?string

getLootTableSeed() ​

php
public function getLootTableSeed() : int

readSaveData() ​

php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

setBrushCount() ​

php
public function setBrushCount(int $brushCount) : void

setBrushDirection() ​

php
public function setBrushDirection(int $brushDirection) : void

setItem() ​

php
public function setItem(?\pocketmine\item\Item $item) : void

setLootTable() ​

php
public function setLootTable(?string $lootTable, int $seed = 0) : void

Sets the loot table rolled when the block is first brushed (Bedrock path or Java id). With a seed other than 0, the same seed always uncovers the same item.

unpackLootTable() ​

php
public function unpackLootTable(?\pocketmine\entity\Entity $brushingEntity = null, ?\pocketmine\item\Item $brush = null) : ?\pocketmine\item\Item

Rolls the loot table if it was not rolled yet and returns the item that will be uncovered. Uses the vanilla loot table (exact for the seed) when the vanilla data is available, otherwise a built-in copy of the archaeology tables.

writeSaveData() protected ​

php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.