-
Notifications
You must be signed in to change notification settings - Fork 0
api
Also see Notes for better understanding.
These APIs are functions tags. Call them directly as needed.
Creates a box using storage data.
Storage sbox:in.create:
{
"shape": [[min_x, min_y, min_z, max_x, max_y, max_z]],
"offset": { "x": 0, "y": 0, "z": 0 },
"type": "collision",
"root": true
}-
shape:[[min_x, min_y, min_z, max_x, max_y, max_z]]The list of cube coordinates (matches the format of the Bookshelf Hitbox Module). -
offset:{x:<double>,y:<double>,z:<double>}(Default: {x:0, y:0, z:0}) The positional offset of the box. -
type:"collision"|"interaction"|"both"(Default:"collision")- collision creates a solid collision box.
- interaction creates an interaction box.
- both creates both collision and interaction boxes.
-
root:<bool>(Default:true) Whether to spawn a new root entity for the box.
Creates a box directly inline via a macro argument.
Macro Arguments (with) :
Accepts the same fields as #sbox:create (shape, offset, type, root).
Note: The following function tags require Bookshelf Link Module to work.
Removes a box.
Execution Context:
- Executor: the root entity of the box.
Updates the shape or the type of the box using storage data.
Storage sbox:in.update:
Example:
{
"shape": [[min_x, min_y, min_z, max_x, max_y, max_z]],
"offset": { "x": 0, "y": 0, "z": 0 },
"type": "collision",
"mode": "keep"
}-
shape:[[min_x, min_y, min_z, max_x, max_y, max_z]]The list of cube coordinates (matches the format of the Bookshelf Hitbox Module). -
offset:{x:<double>,y:<double>,z:<double>}(Default: {x:0, y:0, z:0}) The positional offset of the box. -
type:"collision"|"interaction"|"both"(Default: the same type of the original box)- collision creates a solid collision box.
- interaction creates an interaction box.
- both creates both collision and interaction boxes.
-
mode:"keep"|"replace"(Default:"keep") Has lower priority thantype.-
keep: Keep original type. -
replace: Replace the original type. (If set toreplace, the default type will revert to"collision").
-
Updates a box directly inline via a macro argument.
Macro Arguments (with) :
Accepts the same fields as #sbox:update_shape (shape, offset, type, mode).
These APIs are function tags. Add your functions into these tags.
Note: This function tag requires Bookshelf Link Module to work.
Triggered when creating the box or updating the box. Used for initializing the root, before calling function tag #sbox:init/boxes.
Execution Context:
| Context | Value |
|---|---|
| Executor | The root entity (root: true) or the same as #sbox:create (root: false) |
| Dimension | The same as #sbox:create |
| Position | The same as #sbox:create |
| Rotation | The same as #sbox:create |
| Anchor | The same as #sbox:create |
Triggered when creating the box or updating the box. Used for initializing the unit roots and interactions.
Execution Context:
| Context | Value |
|---|---|
| Executor | The unit roots and interactions |
| Dimension | The same as #sbox:create |
| Position | The same as #sbox:create |
| Rotation | The same as #sbox:create |
| Anchor | The same as #sbox:create |
Triggered before initializing the root, unit roots and interactions(before calling #sbox:init/root and #sbox:init/boxes).
Execution Context:
| Context | Value |
|---|---|
| Executor | The same as #sbox:create |
| Dimension | The same as #sbox:create |
| Position | The same as #sbox:create |
| Rotation | The same as #sbox:create |
| Anchor | The same as #sbox:create |
Triggered before killing the box.
Execution Context:
| Context | Value |
|---|---|
| Executor | The root entity |
| Dimension | The same as #sbox:remove |
| Position | The same as #sbox:remove |
| Rotation | The same as #sbox:remove |
| Anchor | The same as #sbox:remove |
Triggered when hitting the box.
Execution Context:
| Context | Value |
|---|---|
| Executor | The player who hits the box |
| Dimension | The player's current dimension |
| Position | The position of the player |
| Rotation | The rotation of the player |
| Anchor | feet |
Triggered when interacting with the box. The box type must be "both" or "interaction".
Execution Context:
| Context | Value |
|---|---|
| Executor | The player who interacts with the box |
| Dimension | The player's current dimension |
| Position | The position of the player |
| Rotation | The rotation of the player |
| Anchor | feet |
These APIs are predicates. Call them directly as needed.
Check whether the entity is a unit root or an interaction.
Check whether the entity is an interaction.
Check whether the entity is a unit root.
Does anyone actually look this?