Skip to main content

HolderWrapper

Returned by OriginsJS.getHolder(entity). Wraps the entity's origin and power components.


Origin Methods​

setOrigin(layerId, originId)​

(layerId: string, originId: string) => void

Sets the origin for a specific layer.

holder.setOrigin("origins:origin", "origins:avian");

clearOrigin(layerId)​

(layerId: string) => void

Clears the origin from the given layer.

hasOrigin(originId)​

(originId: string) => boolean

Returns true if the entity has the given origin in any layer.

hasOriginInLayer(layerId, originId)​

(layerId: string, originId: string) => boolean

Returns true if the entity has the given origin in the specific layer.

hasLayer(layerId)​

(layerId: string) => boolean

Returns true if an origin is assigned to that layer.

getOriginId(layerId)​

(layerId: string) => string | null

Returns the origin ID for the layer, or null if none.

getAllOrigins()​

() => string[][]

Returns an array of [layerId, originId] pairs.

hasAllOrigins()​

() => boolean

Returns true if every origin layer has an origin assigned.


Power Methods​

grantPower(source, powerId)​

(source: string, powerId: string) => void

Grants a power.

holder.grantPower("origins_js:script", "origins:fire_immunity");

revokePower(source, powerId)​

(source: string, powerId: string) => void

Revokes a power.

revokeAllPowers(source)​

(source: string) => void

Revokes all powers that were granted from the given source.

hasPower(powerId)​

(powerId: string) => boolean

Returns true if the entity has the given power.

getAllPowerIds()​

() => string[]

Returns all power IDs currently held by the entity.


Resource / Cooldown Methods​

MethodSignatureNotes
getResource(powerId)string => numberAlways 0 on 1.20.1
setResource(powerId, value)(string, number) => voidNot supported on 1.20.1
addResource(powerId, delta)(string, number) => voidNot supported on 1.20.1
getCooldown(powerId)string => numberAlways 0 on 1.20.1
startCooldown(powerId)string => voidNot supported on 1.20.1
canUseCooldown(powerId)string => booleanNot supported on 1.20.1