Skip to content

Commit 35adcbd

Browse files
committed
Updated docs
1 parent ae8239e commit 35adcbd

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

doc/API.md

+18-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77
* `stateString` is the string representation of a block
88
* `biomeId` is the biome numerical id
99

10-
#### Block(type,biomeId,metadata)
10+
#### Block.fromProperties(typeId, properties, biomeId)
11+
12+
* `typeId` - The block type ID (numerical or string)
13+
* `properties` - A dictionary of block state properties to build from
14+
* `biomeId` - The biome numerical id
15+
16+
#### Block(type, biomeId, metadata, stateId = null)
1117

1218
Constructor of a block
1319
* `type` is the block numerical id
1420
* `biomeId` is the biome numerical id
1521
* `metadata` is the metadata numerical value
22+
* `stateId` (optional) represents the state of the block (same as metadata in newer versions)
1623

1724
#### block.canHarvest(heldItemType)
1825

@@ -45,15 +52,19 @@ Numerical id.
4552

4653
#### block.name
4754

55+
Minecraft ID (string) of the block.
56+
4857
#### block.displayName
4958

59+
Display name of the block.
60+
5061
#### block.shapes
5162

5263
Array of bounding boxes representing the block shape. Each bounding box is an array of the form `[xmin, ymin, zmin, xmax, ymax, zmax]`. Depends on the type and state of the block.
5364

5465
#### block.entity
5566

56-
If this block is a block entity, this contains the NBT data for the entity
67+
If this block is a block entity, this contains the NBT data for the entity.
5768

5869
#### block.blockEntity
5970

@@ -93,7 +104,7 @@ Boolean, whether the block is considered diggable.
93104

94105
#### block.boundingBox
95106

96-
The shape of the block according to the physics engine's collision decection. Currently one of:
107+
The shape of the block according to the physics engine's collision detection. Currently one of:
97108

98109
* `block` - currently, partially solid blocks, such as half-slabs and ladders, are considered entirely solid.
99110
* `empty` - such as flowers and lava.
@@ -131,11 +142,12 @@ Sets the text for the sign, can be plaintext, or array of JSON or prismarine-cha
131142

132143
#### getSignText (): [string, string?]
133144

134-
Gets the plain text content of the sign, the first item of the array returned and the second is the back and will be undefined for versions that don't support writing on the back of signs.
145+
Gets the plain text content of the sign. The first item of the array returned and the second is the back, which will be undefined for versions that don't support writing on the back of signs.
135146

136147
#### get .signText
137148

138-
Deprecated, returns a plaintext string containing the sign's text
149+
Deprecated, returns a plaintext string containing the sign's text.
139150

140151
#### set .signText
141-
Deprecated, sets the text for a sign's text, can be plaintext, or array of JSON or prismarine-chat instances
152+
153+
Deprecated, sets the text for a sign's text. Can be plaintext, or array of JSON or prismarine-chat instances.

0 commit comments

Comments
 (0)