Skip to content

LoomTransaction 5.46.0 ​

class · pocketmine\inventory\transaction\LoomTransaction · source

Extends InventoryTransaction

Adding a pattern to a banner in a loom (vanilla LoomMenu): a banner and a dye give the banner one more layer of the chosen pattern in the dye's colour. Charge, thing, globe, snout, flow, guster, field masoned and bordure indented patterns need their banner pattern item in the third slot, which is kept. A banner has at most 6 layers.

Constants ​

MAX_LAYERS ​

php
public const MAX_LAYERS = 6

Methods ​

__construct() ​

php
public function __construct(\pocketmine\player\Player $source, \pocketmine\item\Item $expected, array $actions = [])

calculateResult() ​

php
public static function calculateResult(\pocketmine\item\Item $banner, \pocketmine\item\Item $dye, ?\pocketmine\item\Item $patternItem, \pocketmine\block\utils\BannerPatternType $pattern) : ?\pocketmine\item\Item

The banner with the pattern added, or null if the loom can't make it.

needsPatternItem() ​

php
public static function needsPatternItem(\pocketmine\block\utils\BannerPatternType $type) : bool

Whether the pattern can only be made with a banner pattern item.

validate() ​

php
public function validate() : void

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