Skip to content

Crafter 5.46.0 ​

class · pocketmine\block\Crafter · source

Extends Opaque

Crafter (Minecraft Wiki "Crafter"): on a rising redstone edge, waits 4 game ticks, then crafts one recipe from its 3x3 grid and ejects the result from its front, into a container if there is one (whatever does not fit is dropped), followed by the leftovers of the ingredients (empty buckets and bottles).

Constants ​

CRAFTING_STATE_TICKS ​

php
public const CRAFTING_STATE_TICKS = 6

How long the "crafting" state (open mouth, glowing top) lasts after a craft (Java crafting_ticks_remaining).

CRAFT_DELAY_TICKS ​

php
public const CRAFT_DELAY_TICKS = 4

Properties ​

$crafting protected ​

php
protected bool $crafting

$orientation protected ​

php
protected \pocketmine\block\utils\CrafterOrientation $orientation

$triggered protected ​

php
protected bool $triggered

Methods ​

craft() ​

php
public function craft(\pocketmine\block\tile\Crafter $tile) : bool

Crafts once if the grid holds a valid recipe. Returns whether something was crafted.

describeBlockOnlyState() protected ​

php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : void

getCraftingRemainder() ​

php
public static function getCraftingRemainder(\pocketmine\item\Item $item) : ?\pocketmine\item\Item

Returns the item left behind by an ingredient when crafting (vanilla "crafting remainder"), or null.

getOrientation() ​

php
public function getOrientation() : \pocketmine\block\utils\CrafterOrientation

isCrafting() ​

php
public function isCrafting() : bool

isTriggered() ​

php
public function isTriggered() : bool

onInteract() ​

php
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : bool

onNearbyBlockChange() ​

php
public function onNearbyBlockChange() : void

onScheduledUpdate() ​

php
public function onScheduledUpdate() : void

place() ​

php
public function place(\pocketmine\world\BlockTransaction $tx, \pocketmine\item\Item $item, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null) : bool

setCrafting() ​

php
public function setCrafting(bool $crafting) : self

setOrientation() ​

php
public function setOrientation(\pocketmine\block\utils\CrafterOrientation $orientation) : self

setTriggered() ​

php
public function setTriggered(bool $triggered) : self

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