Dog
A dog companion belonging to a player: an NPC of the game's dog class with an owner and a mode. When its owner leaves, it is removed, or with removedWithOwner false, it waits there until giveTo hands it to someone. The NPC events npcDamage and npcDeath also fire for its body.
dog.spawn()
Dog.spawn(owner, position, rotation, soul, name)Spawns a dog for an owner.
dog.all()
Dog.all()All dog companions.
dog.getById()
Dog.getById(id)The dog with this network id, or null.
dog.soul
soulThe game soul it was spawned from.
dog.name
nameIts name, shown on all players' nameplates. You can assign to it.
dog.ownerId
ownerIdThe owner's player id, or 0 with no owner.
dog.owner
ownerThe owner, or null.
dog.removedWithOwner
removedWithOwnerWhether the dog is removed when its owner leaves, true by default. With false, it stays there with no owner.
dog.mode
modeThe companion mode: 0 Wait, staying put; 1 Follow, the default, trailing the owner and running to catch up; 4 Search, roaming to places within 12 m of the owner; 5 Hunt, running at the nearest living animal within 40 m, chasing it up to 80 m and biting for 12 health per second, as the attacker, or following the owner if none; and 2 Free, 3 Aggressive, 6 Guard and 7 Ambush, which are not implemented yet, so the dog stays put. Assigning sends the order again, and dogModeChanged fires only if the mode differs.
dog.objective
objectiveWhat it is doing: 'waiting', 'following', 'searching', 'hunting', or 'idle' in a mode not yet implemented.
dog.morale
moraleThe dog's morale. The game does not report it yet, so it is always 0.
dog.dimension
dimensionIts dimension, which is the owner's when spawned.
dog.position
positionIts location. Assigning teleports it.
dog.rotation
rotationThe direction it faces.
dog.state
stateIts shared state.
dog.giveTo()
giveTo(player)Changes the owner. null removes the owner.
dog.destroy()
destroy()Removes the dog.
dog.id
id: numberThe dog's network id, the same as its NPC's.