LoomTransaction 5.46.0
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 = 6Methods
__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\ItemThe 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) : boolWhether the pattern can only be made with a banner pattern item.
validate()
php
public function validate() : void