Conduit 5.46.0
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
public const AMBIENT_SOUND_INTERVAL_TICKS = 80ATTACK_DAMAGE
public const ATTACK_DAMAGE = 4.0ATTACK_RANGE
public const ATTACK_RANGE = 8EFFECT_DURATION_TICKS
public const EFFECT_DURATION_TICKS = 260MIN_ACTIVE_FRAME_BLOCKS
public const MIN_ACTIVE_FRAME_BLOCKS = 16MIN_ATTACK_FRAME_BLOCKS
public const MIN_ATTACK_FRAME_BLOCKS = 42UPDATE_INTERVAL_TICKS
public const UPDATE_INTERVAL_TICKS = 40Properties
$waterlogged protected
protected bool $waterloggedMethods
countFrameBlocks()
public static function countFrameBlocks(\pocketmine\world\World $world, int $x, int $y, int $z) : intReturns 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()
public static function getEffectRange(int $frameBlocks) : intReturns the radius in blocks within which players get Conduit Power: 16 per 7 frame blocks (16-96).
getLightLevel()
public function getLightLevel() : intgetSupportType()
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportTypeisFrameBlock()
public static function isFrameBlock(\pocketmine\block\Block $block) : boolBlocks a conduit frame can be built with.
isInWaterOrRain()
public static function isInWaterOrRain(\pocketmine\entity\Living $entity) : boolReturns whether the entity is in water (feet or eyes) or in the rain.
isWaterAt()
public static function isWaterAt(\pocketmine\world\World $world, int $x, int $y, int $z) : boolReturns 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()
public function isWaterlogged() : boolonBreak()
public function onBreak(\pocketmine\item\Item $item, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolonNearbyBlockChange()
public function onNearbyBlockChange() : voidonScheduledUpdate()
public function onScheduledUpdate() : voidplace()
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) : boolreadStateFromWorld()
public function readStateFromWorld() : \pocketmine\block\BlockrecalculateCollisionBoxes() protected
protected function recalculateCollisionBoxes() : arraysetWaterlogged()
public function setWaterlogged(bool $waterlogged) : selfupdateConduit()
public function updateConduit(\pocketmine\block\tile\Conduit $tile, bool $firstUpdate = false) : voidRecomputes the frame, plays the sounds, gives Conduit Power and attacks hostile mobs. Called every 40 ticks.
