Skip to content

HappyGhast 5.46.0 ​

class · pocketmine\entity\animal\HappyGhast · source

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 ​

php
public const TAG_HARNESS = "Harness"

Methods ​

canBeRiddenBy() ​

php
public function canBeRiddenBy(\pocketmine\entity\Entity $entity) : bool

canBeSteeredBy() ​

php
public function canBeSteeredBy(\pocketmine\player\Player $rider) : bool

canBeStoodOn() ​

php
public function canBeStoodOn() : bool

createBaby() protected ​

php
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\Animal

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

findWanderPos() ​

php
public function findWanderPos(int $horizontal, int $vertical, ?\pocketmine\math\Vector3 $awayFrom = null) : ?\pocketmine\math\Vector3

getAdultDrops() protected ​

php
protected function getAdultDrops() : array

getBabyScale() protected ​

php
protected function getBabyScale() : float

getDismountPosition() ​

php
public function getDismountPosition(\pocketmine\entity\Entity $passenger) : \pocketmine\math\Vector3

getFlyingSpeed() protected ​

php
protected function getFlyingSpeed() : float

getHarness() ​

php
public function getHarness() : ?\pocketmine\item\Item

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getRideableSeats() ​

php
public function getRideableSeats() : array

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

isBreedingItem() ​

php
public function isBreedingItem(\pocketmine\item\Item $item) : bool

isDrivenByRiderClient() protected ​

php
protected function isDrivenByRiderClient() : bool

isImmobile() ​

php
public function isImmobile() : bool

Whether 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() ​

php
public function knockBack(float $x, float $z, float $force = self::DEFAULT_KNOCKBACK_FORCE, ?float $verticalLimit = self::DEFAULT_KNOCKBACK_VERTICAL_LIMIT) : void

onInteractWithItem() protected ​

php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : bool

onPassengerRemoved() protected ​

php
protected function onPassengerRemoved(\pocketmine\entity\Entity $passenger) : void

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

sendSpawnPacket() protected ​

php
protected function sendSpawnPacket(\pocketmine\player\Player $player) : void

setHarness() ​

php
public function setHarness(?\pocketmine\item\Item $harness) : void

setImmobile() ​

php
public function setImmobile(bool $immobile) : void

Vanilla become_immobile / become_mobile events.

steer() protected ​

php
protected function steer(\pocketmine\player\Player $rider, \pocketmine\entity\riding\RiderInput $input) : void

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

tickAi() protected ​

php
protected function tickAi(int $currentTick) : void

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