Skip to main content

constants namespace

Namespace: DoriosLib.constants · Package: DoriosLib/index.js

PERMISSION_LEVELS

Maps convenient names to CommandPermissionLevel values:

AliasNative value
anyAny
gamedirector, gameDirectorsGameDirectors
adminAdmin
hostHost
ownerOwner

These keys are accepted by CommandDefinition.permissionLevel.

COMMAND_PARAMETER_TYPES

Maps concise command parameter names to CustomCommandParamType:

AliasesNative type
stringString
int, integerInteger
floatFloat
bool, booleanBoolean
enumEnum
blockBlockType
itemItemType
locationLocation
entity, targetEntitySelector
entityTypeEntityType
playerPlayerSelector

EQUIPMENT_SLOTS

EQUIPMENT_SLOTS: EquipmentSlot[]

Contains the values exposed by the installed Script API EquipmentSlot enum. Use it when iterating valid equipment positions. The entity helpers also validate supplied slot strings against this list.

DIRECTION_VECTORS

DIRECTION_VECTORS: Record<ContainerFace, Vector3>

DirectionVector
north{ x: 0, y: 0, z: -1 }
south{ x: 0, y: 0, z: 1 }
east{ x: 1, y: 0, z: 0 }
west{ x: -1, y: 0, z: 0 }
up{ x: 0, y: 1, z: 0 }
down{ x: 0, y: -1, z: 0 }
const above = DoriosLib.math.offset(
block.location,
DoriosLib.constants.DIRECTION_VECTORS.up,
);

DIMENSIONS

Provides canonical IDs and build-height bounds:

KeyIDMinimum YMaximum Y
overworldminecraft:overworld-64320
netherminecraft:nether0128
endminecraft:the_end0256

UNBREAKABLE_BLOCKS

UNBREAKABLE_BLOCKS: string[]

A shared addon safety policy for blocks that scripted tools should not destroy. Script API does not expose a universal unbreakable property, so this list provides a consistent policy for Dorios addons.

The exported array is mutable. Prefer reading it; mutating shared library policy affects every consumer in the same runtime.

isUnbreakableBlock

isUnbreakableBlock(typeId: string): boolean

Checks membership in UNBREAKABLE_BLOCKS.

VANILLA_CONTAINER_BLOCKS

VANILLA_CONTAINER_BLOCKS: string[]

Known vanilla blocks that expose container-like storage, including chests, barrels, furnaces, hoppers, shulker boxes, dispensers, droppers, and related blocks.

isVanillaContainerBlock

isVanillaContainerBlock(typeId: string): boolean

Checks membership in VANILLA_CONTAINER_BLOCKS. It does not inspect a block instance or guarantee that the instance currently exposes an accessible inventory.