Перейти к содержанию
SoulFire LogoSoulFire

Find blocks

Это руководство доступно только на английском.

POST
/v1/instances/{instance_id}/bots/{bot_id}/live/world/blocks:find

Finds blocks of the given ids within a radius of the bot. Results are sorted by ascending distance.

Authorization

headerAuthorizationBearer <JWT>

Preferred API authentication. Use a JWT with the api audience.

Path Parameters

instance_id*string
Formatuuid
bot_id*string
Formatuuid

Request Body

application/json
  1. body
blockIds*array<string>

Block ids to match (namespaced, e.g. "minecraft:diamond_ore"). A block matches if its id equals any entry in this list.

maxDistance*integer

Maximum search radius in blocks, measured from the bot's current block position. Server clamps to an implementation-defined maximum.

Formatint32
maxCount*integer

Maximum number of matches to return. Results are ordered by ascending distance from the bot.

Formatint32

Response Body

Successful response.

application/json
  1. response
blocks?array<>
Example Request
curl -X POST 'http://127.0.0.1:38765/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/bots/497f6eca-6276-4993-bfeb-53cbbbba6f08/live/world/blocks:find' \
  -H 'Content-Type: application/json' \
  -d '{
  "blockIds": [
    "string"
  ],
  "maxDistance": 0,
  "maxCount": 0
}'
Example Response
{
  "blocks": [
    {
      "position": {
        "x": 0,
        "y": 0,
        "z": 0,
        "dimension": "string"
      },
      "blockId": "string",
      "properties": {
        "property1": "string",
        "property2": "string"
      }
    }
  ]
}

Полезна ли эта страница?