GolemConstruction 5.46.0
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) : ?arrayFinds 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\EntityBuilds the golem whose head was just placed at the given position, if the blocks below form a golem.
