Skip to content

API reference / @jsprismarine/protocol / CameraAimAssistPresetDefinition

Class: CameraAimAssistPresetDefinition ​

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:46

A CameraAimAssistPresetDefinition: a named aim assist configuration that CameraAimAssistPacket and camera presets refer to by identifier, as CameraAimAssistPresetsPacket lists them.

Protocol 2193 wire order: 0. identifier: string, the namespaced CameraAimAssist Identifier, for example "minecraft:aim_assist_default".

  1. exclusion_settings: the four string lists of CameraAimAssistPresetExclusions in the order blocks, entities, block_tags, entity_type_families.
  2. liquid_targeting_list: varuint32 count, then one Item Reference string per item that targets liquids while held.
  3. item_settings: varuint32 count, then one CameraAimAssistItemSetting per item (two strings each).
  4. default_item_settings: optional. A presence byte, then a category name when present.
  5. hand_settings: optional. A presence byte, then a category name when present.

Strings are a varuint32 byte length followed by UTF-8. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/camera-aim-assist-preset-definition/

Extends ​

Constructors ​

Constructor ​

new CameraAimAssistPresetDefinition(identifier?, exclusions?, liquidTargetingList?, itemSettings?, defaultItemSettings?, handSettings?): CameraAimAssistPresetDefinition

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:57

Creates a preset. Every parameter has a default so the static deserialize can construct an empty instance before reading the stream.

Parameters ​

identifier? ​

string = ''

identifier, the namespaced preset name.

exclusions? ​

CameraAimAssistPresetExclusions = ...

exclusion_settings, the targets to skip.

liquidTargetingList? ​

string[] = []

liquid_targeting_list, items that target liquid blocks while held.

itemSettings? ​

CameraAimAssistItemSetting[] = []

item_settings, the category per held item.

defaultItemSettings? ​

string

default_item_settings, the category for items missing from itemSettings. Omitted when undefined.

handSettings? ​

string

hand_settings, the category for an empty hand. Omitted when undefined.

Returns ​

CameraAimAssistPresetDefinition

Overrides ​

NetworkStructure.constructor

Properties ​

defaultItemSettings? ​

optional defaultItemSettings?: string

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:67

default_item_settings, the category for items missing from itemSettings. Omitted when undefined.


exclusions ​

exclusions: CameraAimAssistPresetExclusions

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:59

exclusion_settings, the targets to skip.


handSettings? ​

optional handSettings?: string

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:68

hand_settings, the category for an empty hand. Omitted when undefined.


identifier ​

identifier: string = ''

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:58

identifier, the namespaced preset name.


itemSettings ​

itemSettings: CameraAimAssistItemSetting[] = []

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:66

item_settings, the category per held item.


liquidTargetingList ​

liquidTargetingList: string[] = []

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:65

liquid_targeting_list, items that target liquid blocks while held.

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:120

Reads the six fields in wire order.

Parameters ​

stream ​

BinaryStream

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

Defined in: protocol/src/structure/CameraAimAssistPresetDefinition.ts:101

Writes the six fields in wire order.

Parameters ​

stream ​

BinaryStream

Returns ​

void

Overrides ​

NetworkStructure.serialize


deserialize() ​

static deserialize<T>(this, stream): T

Defined in: protocol/src/NetworkStructure.ts:28

Deserializes the network structure from a binary stream. The constructor runs with no arguments before the stream is read, so the class must tolerate that.

Type Parameters ​

T ​

T extends NetworkStructure

Parameters ​

this ​

Constructor<T>

stream ​

NetworkBinaryStream

The binary stream to deserialize from.

Returns ​

T

An instance of the class T.

Inherited from ​

NetworkStructure.deserialize