Skip to content

Jockeys 5.46.0 ​

final class · pocketmine\entity\riding\Jockeys · source

Jockeys: mobs spawned riding other mobs, with the vanilla Bedrock chances of the "minecraft:entity_spawned" events (which also apply to spawn eggs):

  • spider: 1% spawn with a skeleton rider, 80% of them a biome one (stray at night on snow, bogged at night in swamps, parched at night in deserts, wither skeleton in the Nether), otherwise a skeleton at night or underground;
  • zombie, husk, drowned, zombified piglin: 4.25% spawn as babies and 0.75% as baby jockeys, which look for a mount (a chicken, an unsaddled pig, a spider, a wild horse...) within 16 blocks (vanilla behavior.find_mount);
  • strider (adults): 2 in 50 spawn saddled with a zombified piglin rider holding a warped fungus on a stick, 8 in 50 with a baby strider on top;
  • camel husk, naturally spawned: always with a husk rider holding an iron spear and a parched behind it;
  • drowned, naturally spawned in an ocean: about 1.6% come as an adult with a trident riding a zombie nautilus;
  • zombie horse, naturally spawned: always with an adult zombie rider (vanilla spawn_adult_with_rider / horse_wild_with_rider; the iron spear of zombie_rider_equipment is missing: zombies hold no items yet).

Camel husk, zombie horse and drowned riders only come with natural spawns (vanilla herd events of the spawn rules), not with spawn eggs.

Jockeys::onMobSpawned() is called for spawn eggs and is meant for natural spawning too. Ravager riders are spawned by raids.

Constants ​

BABY_ZOMBIE_CHANCE ​

php
public const BABY_ZOMBIE_CHANCE = 425

BABY_ZOMBIE_JOCKEY_CHANCE ​

php
public const BABY_ZOMBIE_JOCKEY_CHANCE = 75

DROWNED_RIDER_CHANCE ​

php
public const DROWNED_RIDER_CHANCE = 160

Naturally spawned drowned in an ocean riding a zombie nautilus: vanilla spawns one rider in 5 of 105 ocean packs of 2-4 drowned (drowned spawn rules, initial_event minecraft:as_rider), about 1.6% of them.

SPIDER_JOCKEY_CHANCE ​

php
public const SPIDER_JOCKEY_CHANCE = 100

STRIDER_PARENT_JOCKEY_WEIGHT ​

php
public const STRIDER_PARENT_JOCKEY_WEIGHT = 8

STRIDER_PIGLIN_JOCKEY_WEIGHT ​

php
public const STRIDER_PIGLIN_JOCKEY_WEIGHT = 2

Methods ​

addRider() ​

php
public static function addRider(\pocketmine\entity\Entity $vehicle, \pocketmine\entity\Living $rider) : bool

Spawns a rider on the vehicle and makes it ride. Returns false (and removes the rider) if it couldn't get on.

createSkeletonRider() ​

php
public static function createSkeletonRider(\pocketmine\entity\Location $location, bool $biomeSpecific = true) : ?\pocketmine\entity\Living

Returns the skeleton riding a spider jockey spawned here (vanilla spider.json), or null if none may spawn (the default skeleton needs night or being underground).

makeMountSeeker() ​

php
public static function makeMountSeeker(\pocketmine\entity\Mob $mob) : void

Makes the mob look for something to ride within 16 blocks (vanilla behavior.find_mount of baby zombie jockeys).

onMobSpawned() ​

php
public static function onMobSpawned(\pocketmine\entity\Entity $entity, bool $naturalSpawn = false) : void

Applies the vanilla spawn variants (babies and jockeys, see the class doc) to a mob that was just spawned. Call it after Entity::spawnToAll(); mobs spawned from saved data must not go through it.

spawnCamelHuskRiders() ​

php
public static function spawnCamelHuskRiders(\pocketmine\entity\animal\CamelHusk $camelHusk) : array

Spawns the riders of a naturally spawned camel husk (vanilla spawn_with_rider / camel_husk_with_hostile_rider): a husk rider with an iron spear in front, a parched behind. Returns the riders that got on.

spawnChickenJockey() ​

php
public static function spawnChickenJockey(\pocketmine\entity\Location $location, ?\pocketmine\entity\Zombie $rider = null) : \pocketmine\entity\animal\Chicken

Spawns a chicken jockey: a chicken with the given baby zombie (a new baby zombie if null) riding it. Bedrock baby jockeys find their chicken themselves (see Jockeys::makeMountSeeker()); this is for spawners that want one directly.

spawnDrownedRider() ​

php
public static function spawnDrownedRider(\pocketmine\entity\monster\Drowned $drowned) : ?\pocketmine\entity\monster\ZombieNautilus

Makes the drowned a zombie nautilus jockey (vanilla as_rider / drowned_rider: an adult with a trident, which spawns its zombie nautilus). Returns the zombie nautilus, or null if the drowned couldn't get on.

spawnSkeletonJockey() ​

php
public static function spawnSkeletonJockey(\pocketmine\entity\monster\Spider $spider, bool $biomeSpecific = true) : ?\pocketmine\entity\Living

Makes the spider a spider jockey (see Jockeys::createSkeletonRider()). Returns the rider, or null if none could spawn.

spawnStriderJockey() ​

php
public static function spawnStriderJockey(\pocketmine\entity\animal\Strider $strider) : ?\pocketmine\entity\monster\ZombifiedPiglin

Saddles the strider and spawns a zombified piglin riding it, holding a warped fungus on a stick (vanilla zombified_piglin_rider_gear).

spawnStriderParentJockey() ​

php
public static function spawnStriderParentJockey(\pocketmine\entity\animal\Strider $strider) : ?\pocketmine\entity\animal\Strider

Spawns a baby strider riding the strider.

spawnZombieHorseRider() ​

php
public static function spawnZombieHorseRider(\pocketmine\entity\animal\ZombieHorse $horse) : ?\pocketmine\entity\Zombie

Spawns the rider of a naturally spawned zombie horse (vanilla zombie spawn_as_rider): an adult zombie. Returns the rider, or null if it couldn't get on.

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