Skip to content

@pumpkin-plugins/dynamic-lights-pumpkin API / lights/held-items / HeldItemLightLevels

Class: HeldItemLightLevels ​

Defined in: packages/dynamic-lights-pumpkin/src/lights/held-items.ts:4

Resolves the configured light level of held items.

Constructors ​

Constructor ​

new HeldItemLightLevels(sources): HeldItemLightLevels

Defined in: packages/dynamic-lights-pumpkin/src/lights/held-items.ts:8

Accepts item IDs with or without the minecraft: namespace.

Parameters ​

sources ​

Readonly<Record<string, number>>

Returns ​

HeldItemLightLevels

Methods ​

level() ​

level(itemName): number

Defined in: packages/dynamic-lights-pumpkin/src/lights/held-items.ts:13

Returns an item's configured luminance, or zero when it is not a light source.

Parameters ​

itemName ​

string | undefined

Returns ​

number


levelForHands() ​

levelForHands(rightItemName, leftItemName): number

Defined in: packages/dynamic-lights-pumpkin/src/lights/held-items.ts:19

Returns the brighter configured level from a player's main hand and offhand.

Parameters ​

rightItemName ​

string | undefined

leftItemName ​

string | undefined

Returns ​

number

pumpkin-plugins documentation