Skip to content

Target 5.46.0 ​

class · pocketmine\block\Target · source

Extends Opaque

Emits a redstone pulse when hit by a projectile: the closer to the centre of the face, the stronger. Bedrock has no block state for the output, so it only lives in the redstone engine (lost on chunk unload).

Constants ​

ARROW_PULSE_TICKS ​

php
public const ARROW_PULSE_TICKS = 20

PROJECTILE_PULSE_TICKS ​

php
public const PROJECTILE_PULSE_TICKS = 8

Methods ​

calculateHitPower() ​

php
public static function calculateHitPower(int $hitFace, \pocketmine\math\Vector3 $hitVector) : int

Returns the power (1-15) for a hit on the given face at the given position (absolute or relative to the block).

getWeakPower() ​

php
public function getWeakPower(int $face) : int

isRedstoneSource() ​

php
public function isRedstoneSource() : bool

onProjectileHit() ​

php
public function onProjectileHit(\pocketmine\entity\projectile\Projectile $projectile, \pocketmine\math\RayTraceResult $hitResult) : void

onScheduledUpdate() ​

php
public function onScheduledUpdate() : void

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