Skip to content

CopperGolem 5.46.0 ​

class · pocketmine\entity\golem\CopperGolem · source

Extends Mob

Bedrock values (entities/copper_golem.json, 1.21.110): 12 health, 0.6x0.98, movement 0.2, panics at 1.5x, wanders. Moves items from copper chests to chests (see CopperGolemTransportItemsGoal); the carried items are shown in its hand, dropped when it dies and handed to a player who interacts with an empty hand. Oxidizes one stage every 420-460 minutes (actor property minecraft:oxidation_level, vanilla 504000-552000 ticks) unless waxed with honeycomb; an axe removes the wax or scrapes off one stage, and so does a lightning strike. Once fully oxidized, every tick has a 0.58% chance to turn it into an oxidized copper golem statue facing the same way (vanilla CopperGolem.turnToStatue), if its block is free; scraping an unoxidized statue with an axe brings it back (see \pocketmine\block\CopperGolemStatue). Can wear a poppy (minecraft:has_flower), sheared off. Loot (loot_tables/entities/copper_golem.json): 1-3 copper ingots, plus the poppy. Pressing copper buttons is not implemented.

Constants ​

OXIDATION_LEVELS ​

php
public const OXIDATION_LEVELS = ["unoxidized", "exposed", "weathered", "oxidized"]

OXIDATION_MAX_TICKS ​

php
public const OXIDATION_MAX_TICKS = 552000

OXIDATION_MIN_TICKS ​

php
public const OXIDATION_MIN_TICKS = 504000

Ticks between two oxidation stages (vanilla nextIntBetweenInclusive(504000, 552000)).

TAG_HAS_FLOWER ​

php
public const TAG_HAS_FLOWER = "HasFlower"

TAG_OXIDATION ​

php
public const TAG_OXIDATION = "OxidationLevel"

TAG_OXIDATION_TIMER ​

php
public const TAG_OXIDATION_TIMER = "OxidationTimer"

TAG_WAXED ​

php
public const TAG_WAXED = "IsWaxed"

TURN_TO_STATUE_CHANCE ​

php
public const TURN_TO_STATUE_CHANCE = 0.0058

Chance per tick for a fully oxidized golem to turn into a statue.

Methods ​

canBeLeashed() ​

php
public function canBeLeashed() : bool

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

getDrops() ​

php
public function getDrops() : array

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getOxidationLevel() ​

php
public function getOxidationLevel() : int

hasFlower() ​

php
public function hasFlower() : bool

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

isWaxed() ​

php
public function isWaxed() : bool

onInteractWithItem() protected ​

php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : bool

onStruckByLightning() ​

php
public function onStruckByLightning(\pocketmine\entity\object\LightningBolt $bolt) : void

Lightning scrapes off one oxidation stage (vanilla CopperGolem.thunderHit), besides the usual damage.

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

setChestInteraction() ​

php
public function setChestInteraction(string $interaction) : void

Sets the chest animation (actor property minecraft:chest_interaction): one of the CopperGolemTransportItemsGoal::INTERACTION_* values.

setHasFlower() ​

php
public function setHasFlower(bool $hasFlower) : void

setOxidationLevel() ​

php
public function setOxidationLevel(int $level) : void

setWaxed() ​

php
public function setWaxed(bool $waxed) : void

turnToStatue() ​

php
public function turnToStatue() : bool

Replaces the golem with an oxidized copper golem statue facing the same way, if its block is free (vanilla CopperGolem.canTurnToStatue). The held items drop.

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