Skip to main content

FieldInfo

There are multiple variants of FieldInfo. The most common is the BlockFieldInfo, which is used to specify a field that is a block. The other variants encode "Simple" fields, such as numbers, strings, booleans, and options.

BlockFieldInfo

NameTypeRequiredDescriptionExample
idstringThe key that is used for storing this data in the block data. Matches the key of the item in properties.
canDance
namestring | SimpleOptionsFieldInfoThe name of the field that is shown to the user
Can Dance
acceptsstring[]The keys for block types that are allowed to be used in this field
["blockType"]
defaultanyThe default value for the field-
isListbooleanWhether the field can accept multiple values
false
fullWidthbooleanWhether the field should take up the full width of the drawer
false
typePropertyType.BlockIndicator for this field being a block
PropertyType.Block

SimpleBooleanFieldInfo

NameTypeRequiredDescriptionExample
idstringThe key that is used for storing this data in the block data. Matches the key of the item in properties.
canDance
namestringThe name of the field that is shown to the user
Can Dance
defaultbooleanThe default value for the field
false
typePropertyType.BooleanIndicator for this field being a boolean
PropertyType.Boolean

SimpleNumberFieldInfo

NameTypeRequiredDescriptionExample
idstringThe key that is used for storing this data in the block data. Matches the key of the item in properties.
walkingSpeed
namestringThe name of the field that is shown to the user
Walking Speed
defaultnumberThe default value for the field
10
typePropertyType.NumberIndicator for this field being a number
PropertyType.Number
minnumberMinimum value for field. Defaults to -∞
0
maxnumberMaximum value for field. Defaults to ∞
100
stepnumberStep value for field. Defaults to 1
1
unitsstringThe units for the number field. Defaults to none.
m/s

SimpleStringFieldInfo

NameTypeRequiredDescriptionExample
idstringThe key that is used for storing this data in the block data. Matches the key of the item in properties.
greeting
namestringThe name of the field that is shown to the user
Greeting
defaultstringThe default value for the field
"Hello World!"
typePropertyType.StringIndicator for this field being a string
PropertyType.String

SimpleOptionsFieldInfo

NameTypeRequiredDescriptionExample
idstringThe key that is used for storing this data in the block data. Matches the key of the item in properties.
time
namestringThe name of the field that is shown to the user
Time
defaultstringThe default option selected, based on value.
"am"
typePropertyType.OptionsIndicator for this field being a set of options
PropertyType.Options
options{value: string, label: string}[]Options for the user to select from. Value stored is the value field.
[{value: 'am', label: 'AM'}, {value: 'pm', label: 'PM'}]

SimpleMetadataFieldInfo

NameTypeRequiredDescriptionExample
idstringThe key that is used for storing this data in the block data. Matches the key of the item in properties.
jointData
namestringThe name of the field (although metadata isn't displayed to the user).
Joint Data
defaultanyThe default value for the field
{ "jointType": "continuous", "jointAxis": "x"}
typePropertyType.MetadataIndicator for this field being metadata
PropertyType.Metadata

SimpleVector3FieldInfo

NameTypeRequiredDescriptionExample
idstringThe key that is used for storing this data in the block data. Matches the key of the item in properties.
position
namestringThe name of the field that is shown to the user
Position
defaultnumber[]The default value of the vector3 field
[0, 0, 0]
typePropertyType.Vector3Indicator for this field being a vector-3
PropertyType.Vector3