> For the complete documentation index, see [llms.txt](https://scripting.breeze.rip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scripting.breeze.rip/newgen/api/net/minecraft/world/phys/aabb.md).

# AABB

An axis aligned bounding box.

### Constructors

#### Constructor

> **new AABB**(`x1`, `y1`, `z1`, `x2`, `y2`, `z2`): `AABB`

Creates a box spanning two corners.

**Parameters**

**x1**

`number`

First corner X.

**y1**

`number`

First corner Y.

**z1**

`number`

First corner Z.

**x2**

`number`

Second corner X.

**y2**

`number`

Second corner Y.

**z2**

`number`

Second corner Z.

**Returns**

`AABB`

### Properties

#### maxX

> `readonly` **maxX**: `number`

The largest X.

***

#### maxY

> `readonly` **maxY**: `number`

The largest Y.

***

#### maxZ

> `readonly` **maxZ**: `number`

The largest Z.

***

#### minX

> `readonly` **minX**: `number`

The smallest X.

***

#### minY

> `readonly` **minY**: `number`

The smallest Y.

***

#### minZ

> `readonly` **minZ**: `number`

The smallest Z.

***

#### size

> `readonly` **size**: `number`

The average edge length of the box.

***

#### xSize

> `readonly` **xSize**: `number`

The length along X.

***

#### ySize

> `readonly` **ySize**: `number`

The length along Y.

***

#### zSize

> `readonly` **zSize**: `number`

The length along Z.

### Methods

#### clip()

> **clip**(`from`, `to`): [`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

Where a line segment first enters this box, or null if it misses.

**Parameters**

**from**

[`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

The start of the segment.

**to**

[`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

The end of the segment.

**Returns**

[`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

***

#### contains()

> **contains**(`point`): `boolean`

Whether a point is inside this box.

**Parameters**

**point**

[`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

The point.

**Returns**

`boolean`

***

#### containsXYZ()

> **containsXYZ**(`x`, `y`, `z`): `boolean`

Whether a point is inside this box.

**Parameters**

**x**

`number`

X coordinate.

**y**

`number`

Y coordinate.

**z**

`number`

Z coordinate.

**Returns**

`boolean`

***

#### contract()

> **contract**(`x`, `y`, `z`): `AABB`

Shrinks the box along a movement, only on the side it moves towards.

**Parameters**

**x**

`number`

X movement.

**y**

`number`

Y movement.

**z**

`number`

Z movement.

**Returns**

`AABB`

***

#### deflate()

> **deflate**(`amount`): `AABB`

Shrinks the box on every side.

**Parameters**

**amount**

`number`

The amount to shrink by.

**Returns**

`AABB`

***

#### deflateBy()

> **deflateBy**(`x`, `y`, `z`): `AABB`

Shrinks the box by a separate amount per axis, on both sides.

**Parameters**

**x**

`number`

X amount.

**y**

`number`

Y amount.

**z**

`number`

Z amount.

**Returns**

`AABB`

***

#### distanceTo()

> **distanceTo**(`point`): `number`

The distance from a point to the closest point of this box.

**Parameters**

**point**

[`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

The point.

**Returns**

`number`

***

#### expandTowards()

> **expandTowards**(`x`, `y`, `z`): `AABB`

Stretches the box along a movement, only on the side it moves towards.

**Parameters**

**x**

`number`

X movement.

**y**

`number`

Y movement.

**z**

`number`

Z movement.

**Returns**

`AABB`

***

#### getBottomCenter()

> **getBottomCenter**(): [`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

The center of the bottom face.

**Returns**

[`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

***

#### getCenter()

> **getCenter**(): [`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

The center of the box.

**Returns**

[`Vec3`](/newgen/api/net/minecraft/world/phys/vec3.md)

***

#### inflate()

> **inflate**(`amount`): `AABB`

Grows the box on every side.

**Parameters**

**amount**

`number`

The amount to grow by.

**Returns**

`AABB`

***

#### inflateBy()

> **inflateBy**(`x`, `y`, `z`): `AABB`

Grows the box by a separate amount per axis, on both sides.

**Parameters**

**x**

`number`

X amount.

**y**

`number`

Y amount.

**z**

`number`

Z amount.

**Returns**

`AABB`

***

#### intersect()

> **intersect**(`other`): `AABB`

The box where this and another overlap.

**Parameters**

**other**

`AABB`

The other box.

**Returns**

`AABB`

***

#### intersects()

> **intersects**(`other`): `boolean`

Whether this box overlaps another.

**Parameters**

**other**

`AABB`

The other box.

**Returns**

`boolean`

***

#### intersectsBlock()

> **intersectsBlock**(`pos`): `boolean`

Whether this box overlaps a block.

**Parameters**

**pos**

[`BlockPos`](/newgen/api/net/minecraft/core/blockpos.md)

The block position.

**Returns**

`boolean`

***

#### minmax()

> **minmax**(`other`): `AABB`

The smallest box containing this and another.

**Parameters**

**other**

`AABB`

The other box.

**Returns**

`AABB`

***

#### move()

> **move**(`x`, `y`, `z`): `AABB`

Moves the box.

**Parameters**

**x**

`number`

X offset.

**y**

`number`

Y offset.

**z**

`number`

Z offset.

**Returns**

`AABB`
