πŸ…±οΈBlock Pack

Name
Description
Required
Type
Default

name

Name to refer to this block by in code

Yes

String

display

Display name of the block seen in player's inventory

No

String

meta

Metadata created by React frontend (not documented)

No

Object

mesh

defMesh options for creating a prop block type. Takes precedence over faces array. The mesh must have a geometry attached. The geometry is used as the prop rather than the Object3D and its children.

No

Object

faces

Data that describes the color/texture of each of this block's faces. The array can either have 6 elements (1 for each side in the order SNX, SPX, SNY, SPY, SNZ, SPZ) or 1 element that applies to the entire block

No

Array

faces::color

The solid color to paint the block. If you want this block's color to be entirely derived from its texture, set this to "white" because the solid color and texture colors are always multiplied together.

No

Color

"white"

faces::texture

Object describing the image to paint on the block

No

Object

faces::texture::asste

sset name. The alpha (transparency) channel is ignored.

Yes

String

faces::texture::pos

The coordinates of the actual texture within the asset file. This allows putting multiple textures in the same file (called a texture atlas), decreasing download time. Note that the origin (0, 0) is the top left corner.

No

Box2

entire image

rotate*

Whether or not to rotate the paint and texture based on what direction the block was built from. For example grass would be false, because the top is always green, but wood is true, to have the lighter colored inside of the tree rotated to face whichever block side was originally selected.

No

Boolean

false

lights*

Array of defLight options

No

Object

health*

Default amount of health this block has. The percentage of remaining health determines how cracked the block appears. Health can be depleted either through coding or impact (if enabled).

No

Number

1

maxImpact

Maximum magnitude of impulse this block can sustain from an impact before becoming unsnapped. -1 for infinity (takes no impact damage)

No

Number

2000

gravity

Enum describing the effect of planet's gravity on this type of block

  •     "disabled" - Block is unaffected by gravity
  •     "single" - The block will fall in the direction of gravity if it is not supported underneath by a gravity disabled or chain block
  •     "chain" - This block and any other gravity chain blocks attached to this block will fall as one big bobby object in the direction of gravity if they are not attached to at least one gravity disabled block. Any gravity single blocks supported by the chain will also fall individually

No

String

"disabled"

gravitySnap

Whether to allow this block to snap back to the grid if it has become unsnapped. Does not apply to RBChunks consisting of multiple blocks

No

Boolean

false

unsnapAnimation

Enum describing the physics animation that plays when the unsnaps from the grid. This will always be "ragdoll" for blocks that have gravity enabled

  •     "disabled" - Block instantly vanishes
  •     "ragdoll" - Block turns into a rigid body

n* "crumble" - In addition to ragdoll, the block also crumbles into smaller pieces n* "smithereens" - A poof of dust/smoke is all that remains

No

String

"ragdoll"

material

These will only affect rigid bodies. Players, AI, and vehicles' wheels are not rigid bodies. https://gameworksdocs.nvidia.com/PhysX/4.1/documentation/physxguide/Manual/RigidBodyDynamics.html#friction-and-restitution

No

Object

material::staticFriction

No

Number

0.5

material::dynamicFriction

No

Number

0.5

material::restitution

AKA bounciness. 0 for no bounce, 1 for bouncing back to original height

No

Number

0

interactLabel

Whether or not to automatically add an "interact" label to every block of this type. This is needed because the server is unaware of whether or not the block has client-sided interact events on it.

No

Boolean

false

sound

Dictionary of defSound objects for different events

No

Object

sound::build

No

Object

[build sound from snd-default]

sound::break

No

Object

[break sound from snd-default]

sound::footstep

No

Object

footstep sound from snd-default

impact*

No

Object

/**
 * You may register up to 65536 (2^16) block types
 * 
 * Options for Mod are passed in here as well
 * OPT Array blocks - List of block type objects included in this block pack
 *     REQ String name - Name to refer to this block by in code
 *     REQ String display - Name to refer to this block by in game
 *     OPT Object meta - Metadata created by React frontend (not documented)
 *     OPT Object mesh - defMesh options for creating a prop block type. Takes precedence over faces array. The mesh must have a geometry attached. The geometry is used as the prop rather than the Object3D and its children.
 *     OPT Array faces - Data that describes the color/texture of each of this block's faces. The array can either have 6 elements (1 for each side in the order SNX, SPX, SNY, SPY, SNZ, SPZ) or 1 element that applies to the entire block
 *         OPT Color color ["white"] - The solid color to paint the block. If you want this block's color to be entirely derived from its texture, set this to "white" because the solid color and texture colors are always multiplied together.
 *         OPT Object texture - Object describing the image to paint on the block
 *             REQ String asset - Asset name. The alpha (transparency) channel is ignored.
 *             OPT Box2 pos [entire image] - The coordinates of the actual texture within the asset file. This allows putting multiple textures in the same file (called a texture atlas), decreasing download time. Note that the origin (0, 0) is the top left corner.
n*     OPT Boolean rotate [false] - Whether or not to rotate the paint and texture based on what direction the block was built from. For example grass would be false, because the top is always green, but wood is true, to have the lighter colored inside of the tree rotated to face whichever block side was originally selected.
n*     OPT Object lights - Array of defLight options
n*     OPT Number health [1] - Default amount of health this block has. The percentage of remaining health determines how cracked the block appears. Health can be depleted either through coding or impact (if enabled).
 *     OPT Number maxImpact [2000] - Maximum magnitude of impulse this block can sustain from an impact before becoming unsnapped. -1 for infinity (takes no impact damage)
 *     OPT String gravity ["disabled"] - Enum describing the effect of planet's gravity on this type of block
 *         "disabled" - Block is unaffected by gravity
 *         "single" - The block will fall in the direction of gravity if it is not supported underneath by a gravity disabled or chain block
 *         "chain" - This block and any other gravity chain blocks attached to this block will fall as one big bobby object in the direction of gravity if they are not attached to at least one gravity disabled block. Any gravity single blocks supported by the chain will also fall individually
 *     OPT Boolean gravitySnap [false] - Whether to allow this block to snap back to the grid if it has become unsnapped. Does not apply to RBChunks consisting of multiple blocks
 *     OPT String unsnapAnimation ["ragdoll"] -  Enum describing the physics animation that plays when the unsnaps from the grid. This will always be "ragdoll" for blocks that have gravity enabled
 *         "disabled" - Block instantly vanishes
 *         "ragdoll" - Block turns into a rigid body
n*         "crumble" - In addition to ragdoll, the block also crumbles into smaller pieces
n*         "smithereens" - A poof of dust/smoke is all that remains
 *     OPT Object material - These will only affect rigid bodies. Players, AI, and vehicles' wheels are not rigid bodies. https://gameworksdocs.nvidia.com/PhysX/4.1/documentation/physxguide/Manual/RigidBodyDynamics.html#friction-and-restitution
 *         OPT Number staticFriction [0.5]
 *         OPT Number dynamicFriction [0.5]
 *         OPT Number restitution [0] - AKA bounciness. 0 for no bounce, 1 for bouncing back to original height
 *     OPT Object sound - Dictionary of defSound objects for different events
 *         OPT Object build [build sound from snd-default]
 *         OPT Object break [break sound from snd-default]
 *         OPT Object footstep [footstep sound from snd-default]
n*         OPT Object impact
 */

Last updated