HappyGhast 5.46.0
Extends Animal
Bedrock values (entities/happy_ghast.json, 1.21.90): 20 health, 4x4, babies (ghastlings) scale 0.2375. Floats around slowly (wandering up to 16 blocks around; Bedrock flying speed 0.016, raised here to Java's 0.05 so it visibly moves), ghastlings fly faster (0.083) and stay with nearby players. Tempted by snowballs; feeding a ghastling a snowball takes 10% off its 20 minutes of growing up. Not breedable. No loot; XP 1-3.
Harness: using one on an adult puts it on (shown in the body equipment slot, dropped on death; shears take it off when nobody rides). A harnessed happy ghast carries four players (seats 3.8 up on its four sides, third person camera 8 blocks away) who get off on top of it. The first rider steers it with free camera controls: it flies where the rider looks, jump goes up (vanilla vertical_movement_action 0.5), backwards at half speed; the server moves it at 0.18 blocks per tick when the client doesn't.
Standing on it: while a player (not riding it) is on top, an adult holds still (vanilla entity_sensor and adult_immobile: can_move property false, no movement or knockback, collidable for the clients, axis-aligned). A rider getting off is put on top, so the happy ghast becomes solid before the rider is moved there.
Constants
TAG_HARNESS
public const TAG_HARNESS = "Harness"Methods
canBeRiddenBy()
public function canBeRiddenBy(\pocketmine\entity\Entity $entity) : boolcanBeSteeredBy()
public function canBeSteeredBy(\pocketmine\player\Player $rider) : boolcanBeStoodOn()
public function canBeStoodOn() : boolcreateBaby() protected
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\AnimalentityBaseTick() protected
protected function entityBaseTick(int $tickDiff = 1) : boolfindWanderPos()
public function findWanderPos(int $horizontal, int $vertical, ?\pocketmine\math\Vector3 $awayFrom = null) : ?\pocketmine\math\Vector3getAdultDrops() protected
protected function getAdultDrops() : arraygetBabyScale() protected
protected function getBabyScale() : floatgetDismountPosition()
public function getDismountPosition(\pocketmine\entity\Entity $passenger) : \pocketmine\math\Vector3getFlyingSpeed() protected
protected function getFlyingSpeed() : floatgetHarness()
public function getHarness() : ?\pocketmine\item\ItemgetInitialSizeInfo() protected
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetName()
public function getName() : stringgetNetworkTypeId()
public static function getNetworkTypeId() : stringgetRideableSeats()
public function getRideableSeats() : arrayinitEntity() protected
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisBreedingItem()
public function isBreedingItem(\pocketmine\item\Item $item) : boolisDrivenByRiderClient() protected
protected function isDrivenByRiderClient() : boolisImmobile()
public function isImmobile() : boolWhether the happy ghast holds still because a player stands on it (vanilla can_move property false): it doesn't move, can't be knocked back and is solid for the clients, so players can stand on it.
knockBack()
public function knockBack(float $x, float $z, float $force = self::DEFAULT_KNOCKBACK_FORCE, ?float $verticalLimit = self::DEFAULT_KNOCKBACK_VERTICAL_LIMIT) : voidonInteractWithItem() protected
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : boolonPassengerRemoved() protected
protected function onPassengerRemoved(\pocketmine\entity\Entity $passenger) : voidregisterGoals() protected
protected function registerGoals() : voidsaveNBT()
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsendSpawnPacket() protected
protected function sendSpawnPacket(\pocketmine\player\Player $player) : voidsetHarness()
public function setHarness(?\pocketmine\item\Item $harness) : voidsetImmobile()
public function setImmobile(bool $immobile) : voidVanilla become_immobile / become_mobile events.
steer() protected
protected function steer(\pocketmine\player\Player $rider, \pocketmine\entity\riding\RiderInput $input) : voidsyncNetworkData() protected
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : voidtickAi() protected
protected function tickAi(int $currentTick) : void