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

owner

The 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

rider

The rider, or null.

horse.removedWithOwner

removedWithOwner

Whether it is removed when its owner leaves, true by default.

horse.giveTo()

giveTo(player)

Changes the owner. null removes the owner.

horse.storage

storage

Its 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

gear

Its 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

gearFixed

When 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

look

Its look, { body, head, hair, tail }.

horse.setLook()

setLook(request)

Changes its look, with names from HorseLooks.

horse.knockOut

knockOut

Whether a fatal blow only knocks it out.

horse.breed

breed

Its breed from Horse.breeds(), or null for one of the game's horses.

horse.maxCarryWeight

maxCarryWeight

How much its saddlebags can carry, or null for the game's limit.

horse.maxStamina

maxStamina

Its 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

speed

Its 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

hitPoints

How much a blow's damage is divided across. A higher value loses less health per blow.

horse.health

health

Its health, kept by the server.

horse.maxHealth

maxHealth

Its maximum health, which is 100.

horse.alive

alive

Whether it is alive.

horse.knockedOut

knockedOut

Whether it lies knocked out.

horse.unconscious

unconscious

True while it lies knocked out, the same as knockedOut: alive, lying where it fell, until wake(). False for a dead horse.

horse.buffs

buffs

The 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

travelStatus

How 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

dimension

Its dimension. Change it with setDimension.

horse.position

position

Its location. Assigning moves it.

horse.rotation

rotation

The direction it faces.

horse.id

id: number

The network id.

horse.soul

soul: string

The game soul it was spawned from, or '' for the default.

horse.name

name: string

Its 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: number

The owner's player id, or 0.

horse.riderId

riderId: number

The rider's player id, or 0.

horse.mounted

mounted: boolean

Whether someone is riding it.