Skip to content

Conduit 5.46.0 ​

class · pocketmine\block\Conduit · source

Extends Transparent
Implements Waterlogged

Conduit (https://minecraft.wiki/w/Conduit), ported from Java's ConduitBlockEntity.

Every 40 ticks (scheduled block update, nothing runs on the other ticks) the conduit checks that the 3x3x3 cube around it (itself included, so it must be waterlogged) is water, and counts the prismarine, prismarine bricks, dark prismarine and sea lanterns in the three 5x5 rings around it (42 positions). With 16 or more it is active:

  • players in water or rain within 16 blocks per 7 frame blocks (at most 96) get Conduit Power for 13 seconds;
  • with the full frame (42 blocks) it attacks one hostile mob in water or rain within 8 blocks, 4 damage every 2 seconds. The client animates the eye and the particles from the block entity ("Active", "Target").

Like Bedrock, the water of a waterlogged conduit lives in the liquid layer of the subchunk (the conduit has no waterlogged block state), so the waterlogged flag is read from there.

Constants ​

AMBIENT_SOUND_INTERVAL_TICKS ​

php
public const AMBIENT_SOUND_INTERVAL_TICKS = 80

ATTACK_DAMAGE ​

php
public const ATTACK_DAMAGE = 4.0

ATTACK_RANGE ​

php
public const ATTACK_RANGE = 8

EFFECT_DURATION_TICKS ​

php
public const EFFECT_DURATION_TICKS = 260

MIN_ACTIVE_FRAME_BLOCKS ​

php
public const MIN_ACTIVE_FRAME_BLOCKS = 16

MIN_ATTACK_FRAME_BLOCKS ​

php
public const MIN_ATTACK_FRAME_BLOCKS = 42

UPDATE_INTERVAL_TICKS ​

php
public const UPDATE_INTERVAL_TICKS = 40

Properties ​

$waterlogged protected ​

php
protected bool $waterlogged

Methods ​

countFrameBlocks() ​

php
public static function countFrameBlocks(\pocketmine\world\World $world, int $x, int $y, int $z) : int

Returns the number of frame blocks (0-42) around a conduit at the given position, or 0 if the 3x3x3 cube around it (itself included) isn't all water.

getEffectRange() ​

php
public static function getEffectRange(int $frameBlocks) : int

Returns the radius in blocks within which players get Conduit Power: 16 per 7 frame blocks (16-96).

getLightLevel() ​

php
public function getLightLevel() : int

getSupportType() ​

php
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportType

isFrameBlock() ​

php
public static function isFrameBlock(\pocketmine\block\Block $block) : bool

Blocks a conduit frame can be built with.

isInWaterOrRain() ​

php
public static function isInWaterOrRain(\pocketmine\entity\Living $entity) : bool

Returns whether the entity is in water (feet or eyes) or in the rain.

isWaterAt() ​

php
public static function isWaterAt(\pocketmine\world\World $world, int $x, int $y, int $z) : bool

Returns whether the block holds water: water (source or flowing), a waterlogged block or water in the liquid layer (blocks of worlds made by vanilla).

isWaterlogged() ​

php
public function isWaterlogged() : bool

onBreak() ​

php
public function onBreak(\pocketmine\item\Item $item, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : bool

onNearbyBlockChange() ​

php
public function onNearbyBlockChange() : void

onScheduledUpdate() ​

php
public function onScheduledUpdate() : void

place() ​

php
public function place(\pocketmine\world\BlockTransaction $tx, \pocketmine\item\Item $item, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null) : bool

readStateFromWorld() ​

php
public function readStateFromWorld() : \pocketmine\block\Block

recalculateCollisionBoxes() protected ​

php
protected function recalculateCollisionBoxes() : array

setWaterlogged() ​

php
public function setWaterlogged(bool $waterlogged) : self

updateConduit() ​

php
public function updateConduit(\pocketmine\block\tile\Conduit $tile, bool $firstUpdate = false) : void

Recomputes the frame, plays the sounds, gives Conduit Power and attacks hostile mobs. Called every 40 ticks.

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