[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / entity/Environment

# entity/Environment

## Interfaces

### FallLanding

Defined in: [packages/prismarine/src/entity/Environment.ts:48](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L48)

How a landing counts a fall: the distance it measures and the share of its damage it deals.

#### Properties

##### distance

> `readonly` **distance**: `number`

Defined in: [packages/prismarine/src/entity/Environment.ts:49](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L49)

##### multiplier

> `readonly` **multiplier**: `number`

Defined in: [packages/prismarine/src/entity/Environment.ts:50](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L50)

## Variables

### BREATH\_TICKS

> `const` **BREATH\_TICKS**: `300` = `300`

Defined in: [packages/prismarine/src/entity/Environment.ts:197](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L197)

How long something can hold its breath, in ticks.

Fifteen seconds, the same as a player's. Kept here rather than read from the metadata because a
mob has no air bar to show anybody - only the moment it runs out matters.

***

### BURN\_TICKS

> `const` **BURN\_TICKS**: `160` = `160`

Defined in: [packages/prismarine/src/entity/Environment.ts:137](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L137)

How long something keeps burning after it stops standing in the fire, in ticks.

Vanilla's eight seconds. It is what makes walking through a fire worse than walking past one,
and what makes water worth running to.

#### Java See

BaseFireBlock.fireIgnite

***

### DROWNING\_DAMAGE

> `const` **DROWNING\_DAMAGE**: `2` = `2`

Defined in: [packages/prismarine/src/entity/Environment.ts:188](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L188)

Half-hearts lost per second once the breath runs out, as in vanilla.

***

### DROWNING\_INTERVAL

> `const` **DROWNING\_INTERVAL**: `20` = `20`

Defined in: [packages/prismarine/src/entity/Environment.ts:189](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L189)

***

### FALL\_GRACE

> `const` **FALL\_GRACE**: `3` = `3`

Defined in: [packages/prismarine/src/entity/Environment.ts:109](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L109)

Blocks of falling anything gets for free.

Vanilla's three: a one block step costs nothing, and neither does a jump from a two block ledge.
Above that it is one half-heart per further block.

***

### FIRE\_BLOCK\_DAMAGE

> `const` **FIRE\_BLOCK\_DAMAGE**: `Readonly`\<`Record`\<`string`, `number`\>\>

Defined in: [packages/prismarine/src/entity/Environment.ts:151](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L151)

The fire blocks, and the `inFire` damage each deals every tick something stands in it, which a
blow's grace period spaces out: Java's `FireBlock` and `SoulFireBlock` pass 1 and 2 to
`BaseFireBlock`.

#### Java See

BaseFireBlock.entityInside

***

### HAZARD\_DAMAGE

> `const` **HAZARD\_DAMAGE**: `Readonly`\<`Record`\<`string`, `number`\>\>

Defined in: [packages/prismarine/src/entity/Environment.ts:124](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L124)

Half-hearts each hazard is worth per [HAZARD\_INTERVAL](#hazard-interval).

***

### HAZARD\_INTERVAL

> `const` **HAZARD\_INTERVAL**: `10` = `10`

Defined in: [packages/prismarine/src/entity/Environment.ts:121](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L121)

How often standing in something harmful hurts, in ticks.

***

### LANDING\_BLOCK\_OFFSET

> `const` **LANDING\_BLOCK\_OFFSET**: `0.2` = `0.2`

Defined in: [packages/prismarine/src/entity/Environment.ts:73](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L73)

How far below the feet Java finds the block a body lands on, `Entity.getOnPosLegacy`.

***

### LAVA\_BURN\_TICKS

> `const` **LAVA\_BURN\_TICKS**: `300` = `300`

Defined in: [packages/prismarine/src/entity/Environment.ts:143](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L143)

How long something keeps burning after it leaves lava, in ticks: Java's fifteen seconds.

#### Java See

Entity.lavaIgnite

***

### ON\_FIRE\_DAMAGE

> `const` **ON\_FIRE\_DAMAGE**: `1` = `1`

Defined in: [packages/prismarine/src/entity/Environment.ts:185](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L185)

The `onFire` damage a burning entity takes each [ON\_FIRE\_INTERVAL](#on-fire-interval), in half-hearts.

***

### ON\_FIRE\_INTERVAL

> `const` **ON\_FIRE\_INTERVAL**: `20` = `20`

Defined in: [packages/prismarine/src/entity/Environment.ts:182](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L182)

How often a burning entity takes `onFire` damage, in ticks: Java's `Entity.baseTick` hurts it
whenever its fire ticks are a multiple of 20.

#### Java See

Entity.baseTick

***

### SUFFOCATION\_DAMAGE

> `const` **SUFFOCATION\_DAMAGE**: `1` = `1`

Defined in: [packages/prismarine/src/entity/Environment.ts:169](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L169)

Half-hearts a tick of suffocation costs, and how often - vanilla charges it every tick.

***

### SUFFOCATION\_INTERVAL

> `const` **SUFFOCATION\_INTERVAL**: `10` = `10`

Defined in: [packages/prismarine/src/entity/Environment.ts:170](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L170)

***

### VOID\_DAMAGE

> `const` **VOID\_DAMAGE**: `4` = `4`

Defined in: [packages/prismarine/src/entity/Environment.ts:174](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L174)

***

### VOID\_DEPTH

> `const` **VOID\_DEPTH**: `64` = `64`

Defined in: [packages/prismarine/src/entity/Environment.ts:173](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L173)

The void: how far below the world's floor is fatal, and what it costs.

***

### VOID\_INTERVAL

> `const` **VOID\_INTERVAL**: `10` = `10`

Defined in: [packages/prismarine/src/entity/Environment.ts:175](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L175)

## Functions

### breaksAFall()

> **breaksAFall**(`name`, `tags`): `boolean`

Defined in: [packages/prismarine/src/entity/Environment.ts:100](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L100)

Whether landing in or on a block costs nothing.

Three groups rather than one list. Any liquid, which is what makes a bucket of water at the
bottom of a drop the standard way down. Anything in the `#minecraft:climbable` block tag read
from the server's content tags - ladders, vines, scaffolding, weeping and twisting vines, and
cave vines. And FALL\_BREAKERS, the blocks Java softens a landing with in code.

#### Parameters

##### name

`string`

The block's state name.

##### tags

[`ContentTags`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/tags/index.md#contenttags) \| `undefined`

The server's merged content tags, or undefined when
  no content is loaded.

#### Returns

`boolean`

Whether a fall into it is free.

***

### igniteByContact()

> **igniteByContact**(`fireTicks`, `inLava`, `inFire`): `number`

Defined in: [packages/prismarine/src/entity/Environment.ts:165](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L165)

The longer of the burn an entity has left and the one its contact gives it, as Java's
`Entity.igniteForTicks` keeps the longer.

#### Parameters

##### fireTicks

`number`

The burn it has left.

##### inLava

`boolean`

Whether it touches lava.

##### inFire

`boolean`

Whether it touches a fire block.

#### Returns

`number`

How long it burns from now.

#### Java See

Entity.igniteForTicks

***

### isAllowed()

> **isAllowed**(`world`, `cause`): `boolean`

Defined in: [packages/prismarine/src/entity/Environment.ts:218](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L218)

Whether the world is set to allow this kind of damage at all.

#### Parameters

##### world

[`World`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/World/classes/World.md)

Where it is happening.

##### cause

[`DamageCause`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/DamageCause/index.md#damagecause-1)

What kind of damage.

#### Returns

`boolean`

`true` if it should be applied.

***

### isUnderwater()

> **isUnderwater**(`name`): `boolean`

Defined in: [packages/prismarine/src/entity/Environment.ts:118](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L118)

Whether a block is water, still or flowing.

What counts as being underwater. Lava burns rather than drowns, so it answers false for it.

#### Parameters

##### name

`string`

The block's state name.

#### Returns

`boolean`

Whether something standing in it would be holding its breath.

***

### landingOn()

> **landingOn**(`content`, `block`, `fallen`): [`FallLanding`](#falllanding)

Defined in: [packages/prismarine/src/entity/Environment.ts:62](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/Environment.ts#L62)

How landing on a block counts a fall, Java's `Block.fallOn` for it: a bed takes its fall
distance reduction off the fall, half of it, and hay and honey deal a fifth of the damage.

#### Parameters

##### content

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

The server's content, whose block table holds each state's reduction.

##### block

[`ContentBlock`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentblock) \| `undefined`

The block the body lands on, the one 0.2 under its feet.

##### fallen

`number`

How far the body fell.

#### Returns

[`FallLanding`](#falllanding)

#### Java Source

Block.fallOn
