Skip to content

GolemConstruction 5.46.0 ​

final class · pocketmine\entity\golem\GolemConstruction · source

Building golems by placing a carved pumpkin or a jack o'lantern on top of a body (vanilla CarvedPumpkinBlock):

  • snow golem: two snow blocks;
  • iron golem: a T of four iron blocks with air in the two corners beside the head and beside the legs (built in either horizontal direction); the golem is player-created and never turns on players;
  • copper golem: one copper block (any oxidation, waxed or not), which turns into a copper chest of the same oxidation and wax facing like the pumpkin; the golem stands on it with the oxidation of the block. Snow golems are checked first, then iron golems, then copper golems. The pattern blocks are removed with break particles. Only upright patterns count (Java also accepts lying ones, Bedrock does not).

Constants ​

COPPER_GOLEM ​

php
public const COPPER_GOLEM = "copper_golem"

IRON_GOLEM ​

php
public const IRON_GOLEM = "iron_golem"

SNOW_GOLEM ​

php
public const SNOW_GOLEM = "snow_golem"

Methods ​

findPattern() ​

php
public static function findPattern(\Closure $getBlock, int $x, int $y, int $z) : ?array

Finds the golem pattern whose head is the pumpkin at the given position.

trySpawnGolem() ​

php
public static function trySpawnGolem(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pumpkinPos) : ?\pocketmine\entity\Entity

Builds the golem whose head was just placed at the given position, if the blocks below form a golem.

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