Jockeys 5.46.0
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
public const BABY_ZOMBIE_CHANCE = 425BABY_ZOMBIE_JOCKEY_CHANCE
public const BABY_ZOMBIE_JOCKEY_CHANCE = 75DROWNED_RIDER_CHANCE
public const DROWNED_RIDER_CHANCE = 160Naturally 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
public const SPIDER_JOCKEY_CHANCE = 100STRIDER_PARENT_JOCKEY_WEIGHT
public const STRIDER_PARENT_JOCKEY_WEIGHT = 8STRIDER_PIGLIN_JOCKEY_WEIGHT
public const STRIDER_PIGLIN_JOCKEY_WEIGHT = 2Methods
addRider()
public static function addRider(\pocketmine\entity\Entity $vehicle, \pocketmine\entity\Living $rider) : boolSpawns a rider on the vehicle and makes it ride. Returns false (and removes the rider) if it couldn't get on.
createSkeletonRider()
public static function createSkeletonRider(\pocketmine\entity\Location $location, bool $biomeSpecific = true) : ?\pocketmine\entity\LivingReturns 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()
public static function makeMountSeeker(\pocketmine\entity\Mob $mob) : voidMakes the mob look for something to ride within 16 blocks (vanilla behavior.find_mount of baby zombie jockeys).
onMobSpawned()
public static function onMobSpawned(\pocketmine\entity\Entity $entity, bool $naturalSpawn = false) : voidApplies 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()
public static function spawnCamelHuskRiders(\pocketmine\entity\animal\CamelHusk $camelHusk) : arraySpawns 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()
public static function spawnChickenJockey(\pocketmine\entity\Location $location, ?\pocketmine\entity\Zombie $rider = null) : \pocketmine\entity\animal\ChickenSpawns 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()
public static function spawnDrownedRider(\pocketmine\entity\monster\Drowned $drowned) : ?\pocketmine\entity\monster\ZombieNautilusMakes 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()
public static function spawnSkeletonJockey(\pocketmine\entity\monster\Spider $spider, bool $biomeSpecific = true) : ?\pocketmine\entity\LivingMakes the spider a spider jockey (see Jockeys::createSkeletonRider()). Returns the rider, or null if none could spawn.
spawnStriderJockey()
public static function spawnStriderJockey(\pocketmine\entity\animal\Strider $strider) : ?\pocketmine\entity\monster\ZombifiedPiglinSaddles the strider and spawns a zombified piglin riding it, holding a warped fungus on a stick (vanilla zombified_piglin_rider_gear).
spawnStriderParentJockey()
public static function spawnStriderParentJockey(\pocketmine\entity\animal\Strider $strider) : ?\pocketmine\entity\animal\StriderSpawns a baby strider riding the strider.
spawnZombieHorseRider()
public static function spawnZombieHorseRider(\pocketmine\entity\animal\ZombieHorse $horse) : ?\pocketmine\entity\ZombieSpawns 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.
