useResource
useResource(
entity,key): {current:number;maximum:number;reserved?:number; } |undefined
An entity’s amount of the resource key, read from
the world: { current, maximum, reserved }, or undefined while it has
none. What <ResourceBar> draws, and the way to draw it any other way,
such as an orb, a ring or a number.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
entity |
Entity | null |
key |
ResourceKey |
Returns
Section titled “Returns”Type Literal
Section titled “Type Literal”{ current: number; maximum: number; reserved?: number; }
| Name | Type | Description |
|---|---|---|
current |
number |
- |
maximum |
number |
- |
reserved? |
number |
What a running cast holds back. Health has none, since no cast holds health back; every other resource has it. |
undefined