Skip to content

ProjectileAim 5.46.0 ​

final class · pocketmine\entity\ai\ProjectileAim · source

Aiming of thrown projectiles (snowballs of snow golems, llama spit): like Java's throwers, aims at a third of the target's height plus 20% of the horizontal distance upwards to make up for gravity.

Methods ​

aim() ​

php
public static function aim(\pocketmine\entity\Mob $shooter, \pocketmine\entity\Living $target, float $speed, float $inaccuracy) : ?array

Returns the spawn location (at the mob's eyes, facing the shot) and the motion of a projectile shot at the target, or null if the target is at the mob's eyes.

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