Skip to content

CopperTrait ​

trait · pocketmine\block\utils\CopperTrait · source

Methods ​

describeBlockItemState() ​

php
public function describeBlockItemState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : void

getOxidation() ​

php
public function getOxidation() : \pocketmine\block\utils\CopperOxidation

getWeatheringResult() 5.46.0 protected ​

php
protected function getWeatheringResult() : ?\pocketmine\block\utils\CopperOxidation

Vanilla weathering, for copper blocks that oxidize over time (call it from onRandomTick()). Returns the next oxidation stage if the block should oxidize on this random tick, null otherwise.

Like vanilla, there is a 1 in ~17.6 chance to try; the attempt fails if an unwaxed copper block within 4 blocks (Manhattan distance) is less oxidized, and otherwise succeeds with a chance of ((more oxidized + 1) / (same or more oxidized + 1))², times 0.75 for unoxidized copper.

isWaxed() ​

php
public function isWaxed() : bool

onInteract() ​

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

setOxidation() ​

php
public function setOxidation(\pocketmine\block\utils\CopperOxidation $oxidation) : self

setWaxed() ​

php
public function setWaxed(bool $waxed) : self

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