Represents a two-directional vector.

Example

createVector2.js

const vec2 = { x: 0, y: 0 };

Example

createVector2.ts

import { Vector2 } from "@minecraft/server";

const vec2: Vector2 = { x: 0, y: 0 };

Hierarchy

  • Vector2

Properties

x y

Properties

x: number

Remarks

X component of the two-dimensional vector.

y: number

Remarks

Y component of the two-dimensional vector.