FishingHook 5.46.0
Extends Projectile
Implements NeverSavedWithChunkEntity
Fishing bobber (vanilla FishingHook). Cast with a fishing rod; it floats on water, where after 5 to 30 seconds (5 seconds less per level of Lure; faster in the rain, slower under a roof) a fish swims to it, then bites within 1 to 4 seconds and stays on the hook for 1 to 2 seconds. Reeling in while a fish bites gives an item of the fishing loot table (see FishingLoot; treasure only in open water) thrown towards the player, and 1 to 6 experience. A hooked mob or item is pulled towards the player instead. The rod loses 1 durability per catch, 5 per pulled mob, 3 per pulled item and 2 when the bobber was stuck in a block. The bobber disappears when the player stops holding the rod, dies or goes more than 32 blocks away.
Methods
__construct()
public function __construct(\pocketmine\entity\Location $location, ?\pocketmine\entity\Entity $shootingEntity, ?\pocketmine\item\Item $rod = null, ?\pocketmine\nbt\tag\CompoundTag $nbt = null)canCollideWith()
public function canCollideWith(\pocketmine\entity\Entity $entity) : boolentityBaseTick() protected
protected function entityBaseTick(int $tickDiff = 1) : boolgetActive()
public static function getActive(\pocketmine\player\Player $player) : ?selfReturns the bobber the player has out, if any.
getHookedEntity()
public function getHookedEntity() : ?\pocketmine\entity\EntitygetInitialDragMultiplier() protected
protected function getInitialDragMultiplier() : floatgetInitialGravity() protected
protected function getInitialGravity() : floatgetInitialSizeInfo() protected
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetNetworkTypeId()
public static function getNetworkTypeId() : stringisBiting()
public function isBiting() : boolWhether a fish is on the hook right now (reeling in catches it).
isBobbing()
public function isBobbing() : boolonDispose() protected
protected function onDispose() : voidonHitEntity() protected
protected function onHitEntity(\pocketmine\entity\Entity $entityHit, \pocketmine\math\RayTraceResult $hitResult) : voidretrieve()
public function retrieve(\pocketmine\player\Player $player) : intReels the line in (the player used the rod again): pulls the hooked entity, or catches the fish that is biting. Returns the durability the rod loses.
