Skip to content

NetherPortalBuilder 5.46.0 ​

final class · pocketmine\world\dimension\NetherPortalBuilder · source

Builds the 2x3 portal an entity arrives through when no linked portal exists, like vanilla (simplified):

  • the closest spot within 16 blocks (searching rings outwards) with a solid floor under the portal and room to step out on one side;
  • otherwise a portal standing on a small obsidian platform at the arrival position, with the space around cleared.

Constants ​

SEARCH_RADIUS ​

php
public const SEARCH_RADIUS = 16

Methods ​

build() ​

php
public static function build(\pocketmine\world\World $world, int $x, int $y, int $z, int $axis, bool $platform) : \pocketmine\world\dimension\NetherPortalShape

Builds a lit 2x3 portal (4x5 obsidian frame) with its bottom-left interior block at the given position.

clampY() ​

php
public static function clampY(\pocketmine\world\World $world, int $y) : int

Clamps an arrival position to where a portal may be built in the given world.

create() ​

php
public static function create(\pocketmine\world\World $world, \pocketmine\math\Vector3 $target) : \pocketmine\world\dimension\NetherPortalShape

Builds a new portal as close as possible to the target and records it. The chunks within SEARCH_RADIUS blocks of the target must be loaded.

findSpot() ​

php
public static function findSpot(\pocketmine\world\World $world, \pocketmine\math\Vector3 $target) : ?array

Finds a spot for a new portal near the target position, or returns null if there is none within the search radius.

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