Horse
A horse spawned by the server. Its coat and tack, chosen by the server, look the same in all games. It can have an owner and a rider, follow orders, and has its health kept by the server. A fatal blow kills it, or if spawned with { knockOut: true }, knocks it out.
horse.all()
Horse.all()All horses spawned by the server.
horse.getById()
Horse.getById(id)The horse with this network id, or null.
horse.spawn()
Horse.spawn(position = {}, orientation = {}, soul = '', name = '', gear, options = {})Spawns a horse.
horse.gearSets()
Horse.gearSets()Gear presets from the game's data, sorted by name, including the horse_common, horse_noble, horse_nomad and horse_draft groups and those for specific named horses.
horse.gearList()
Horse.gearList(slot)Gear items from the game's data, for one slot or all, saddles first.
horse.breeds()
Horse.breeds()Breeds from this server's horse config, horses.json, with their look, stamina, speed, carry limit and health. Horse.spawn takes one as `soul` or its `breed` option.
horse.owner
ownerThe owner, or null.
horse.buckRider()
buckRider()Rears the horse to throw its rider, using the game's animation. The rider's game does it and other clients see it. Returns true once sent, and false with no rider.
horse.dragRider()
dragRider(attacker)Has a player pull down this horse's rider. The attacker lunges with the game's move, and the rider leaves the saddle in all games. Returns true once sent, and false with no rider, if the attacker is the rider, or if they are over 5 m from the horse. Throws a TypeError for anything except a Player.
horse.unseatRider()
unseatRider()Dismounts the rider through their client, then fires horseDismount. Returns that player, or null with no rider.
horse.rider
riderThe rider, or null.
horse.removedWithOwner
removedWithOwnerWhether it is removed when its owner leaves, true by default.
horse.giveTo()
giveTo(player)Changes the owner. null removes the owner.
horse.storage
storageIts saddlebags, a Stash.
horse.setDimension()
setDimension(world)Moves the horse to another dimension.
horse.showOnlyTo()
showOnlyTo(player)Lets one player see the horse even outside its dimension, or nobody extra with null.
horse.gear
gearIts tack in four slots: `saddle`, which includes the saddlebags; `head`, for a bridle or chanfron; `torso`, for the harness or caparison over the saddle; and `shoe`. Values are item class names, or null for empty. All clients show the same tack, including the rider's.
horse.gearFixed
gearFixedWhen true, the inventory's Horse tab cannot change this horse's tack, and horseGearChanging stays silent. Scripts are not limited by it. Off by default.
horse.setTack()
setTack(gear)Replaces all its gear on all clients. Throws if an item is not horse gear or is in the wrong slot, or if `torso` has a caparison with no saddle. Fires horseGearChanged with a null player.
horse.fitGear()
fitGear(item)Equips one item in its slot, leaving the others unchanged.
horse.takeOffGear()
takeOffGear(slot)Removes one piece, and the caparison comes off with its saddle. Returns false if the slot was empty.
horse.look
lookIts look, { body, head, hair, tail }.
horse.setLook()
setLook(request)Changes its look, with names from HorseLooks.
horse.knockOut
knockOutWhether a fatal blow only knocks it out.
horse.breed
breedIts breed from Horse.breeds(), or null for one of the game's horses.
horse.maxCarryWeight
maxCarryWeightHow much its saddlebags can carry, or null for the game's limit.
horse.maxStamina
maxStaminaIts stamina, the game's MaxStamina, or null for the game's value. All games' horse souls take it, and the inspect screen and riding use it. You can assign to it.
horse.speed
speedIts speed as the inspect screen shows it, 30 to 60, where the game's horses are about 35, or null for the game's value. You can assign to it.
horse.hitPoints
hitPointsHow much a blow's damage is divided across. A higher value loses less health per blow.
horse.health
healthIts health, kept by the server.
horse.maxHealth
maxHealthIts maximum health, which is 100.
horse.alive
aliveWhether it is alive.
horse.knockedOut
knockedOutWhether it lies knocked out.
horse.unconscious
unconsciousTrue while it lies knocked out, the same as knockedOut: alive, lying where it fell, until wake(). False for a dead horse.
horse.buffs
buffsThe game buffs this server added with addBuff, by the name in the game's tables, in the order added. Buffs the game itself gave are not included.
horse.addBuff()
addBuff(buff)Adds a game buff for the simulating client, all observers and later joiners. The list is lasting, so a buff that wears off, or a recreated body, gets it again, though one that acts once and ends at once is not repeated. Horse buffs change its stats, such as konskeZavody_horseBoost_diff3, a race boost, and item_horse_shoe. An unknown name throws, as does a custom buff from Buffs.register. Returns true if the horse then has it, and false if the horse is gone or at the limit of sixteen.
horse.removeBuff()
removeBuff(buff)Removes one of the server's buffs on all clients, leaving those the game gave. An unknown name throws. Returns true if it was on the list.
horse.hasBuff()
hasBuff(buff)Whether this server added the buff. It reads the server's list, so it answers at once and says nothing about buffs from the game. An unknown name throws.
horse.clearBuffs()
clearBuffs()Removes all buffs this server added, on all clients. Returns true if there were any.
horse.kill()
kill()Kills it, firing horseDeath with the reason 'scripted'.
horse.knockDown()
knockDown()Knocks it out, and nobody can ride it until wake().
horse.wake()
wake(health)Gets a knocked-out horse up.
horse.revive()
revive(health)Brings back a dead horse.
horse.travelStatus
travelStatusHow its current order is going.
horse.moveTo()
moveTo(position, options)Orders it to a position, with `speed` 'walk', 'jog' or 'run'. A rider stays in control.
horse.patrol()
patrol(points, options)Orders it along points, with `speed`, `loop` and `waitSeconds`.
horse.hold()
hold()Drops its order so it stays still.
horse.destroy()
destroy()Removes the horse everywhere, after firing horseDestroy.
horse.dimension
dimensionIts dimension. Change it with setDimension.
horse.position
positionIts location. Assigning moves it.
horse.rotation
rotationThe direction it faces.
horse.id
id: numberThe network id.
horse.soul
soul: stringThe game soul it was spawned from, or '' for the default.
horse.name
name: stringIts name, from Horse.spawn. You can assign to it, and all clients' copies take the new name. A non-string throws a TypeError, and setting it on a horse that is gone does nothing.
horse.ownerId
ownerId: numberThe owner's player id, or 0.
horse.riderId
riderId: numberThe rider's player id, or 0.
horse.mounted
mounted: booleanWhether someone is riding it.