BrushableBlock 5.46.0
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
public const TAG_BRUSH_COUNT = "brush_count"TAG_BRUSH_DIRECTION
public const TAG_BRUSH_DIRECTION = "brush_direction"TAG_ITEM
public const TAG_ITEM = "item"TAG_LOOT_TABLE
public const TAG_LOOT_TABLE = "LootTable"TAG_LOOT_TABLE_SEED
public const TAG_LOOT_TABLE_SEED = "LootTableSeed"TAG_LOOT_TABLE_SEED_LONG
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
public const TAG_TYPE = "type"Properties
$brushCountResetsAtTick
public int $brushCountResetsAtTickserver tick at which unfinished brushing starts to decay (not saved)
$cooldownEndsAtTick
public int $cooldownEndsAtTickserver tick before which brushing does nothing (not saved)
Methods
addAdditionalSpawnData() protected
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidgetBrushCount()
public function getBrushCount() : intgetBrushDirection()
public function getBrushDirection() : intgetItem()
public function getItem() : ?\pocketmine\item\ItemgetLootTable()
public function getLootTable() : ?stringgetLootTableSeed()
public function getLootTableSeed() : intreadSaveData()
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidsetBrushCount()
public function setBrushCount(int $brushCount) : voidsetBrushDirection()
public function setBrushDirection(int $brushDirection) : voidsetItem()
public function setItem(?\pocketmine\item\Item $item) : voidsetLootTable()
public function setLootTable(?string $lootTable, int $seed = 0) : voidSets 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()
public function unpackLootTable(?\pocketmine\entity\Entity $brushingEntity = null, ?\pocketmine\item\Item $brush = null) : ?\pocketmine\item\ItemRolls 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
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void