Introduction

Welcome to BloxDocs! Here, you can find ways to interact with bloxd.io using code!

Please note that some of these might be against the bloxd.io Terms of service. Those sections will have a warning in them.

Bloxd Coding API

This is the official coding API made by bloxd.io devs. All functions' syntax will be shown here.

APIs

The following section has all the bloxd APIs. Various types might be referenced, which will be found in the Referenced Types section.

api.getPosition()

Gets the position of an entity.

  • api.getPosition(entityId);
  • entityId - type EntityId
  • returns:
    [Number, Number, Number];
api.setPosition()

Sets the position of an entity.

  • api.setPosition(entityId, x, y, z);
  • entityId - type EntityId
  • x - type Number | Number[] (if an array is passed, you need not provide y and z)
  • y - type Number | null
  • z - type Number | null
  • returns:
    void;
api.getPlayerIds()

Gets the Player IDs for everyone currently in the lobby.

  • api.getPlayerIds();
  • returns:
    PlayerId[];
api.getNumPlayers()

Gets the number of Players in the lobby.

  • api.getNumPlayers();
  • returns:
    Number;
api.setOptimisations()

Changes whether to enable optimizing block placement (like World Builder) or not.

  • api.setOptimisations(optimise);
  • optimise - type Boolean
  • returns:
    null;
Referenced Types

The following section has all the bloxd types. This includes EntityId, EarthSkybox, etc.

EntityId / LifeformId

The ID of any Player or living entity.

Get a PlayerId using the steps below:

Get an EntityId after you summon it or via callbacks.

PlayerId

The ID of any Player.

Get the PlayerId using:

api.getPlayerId("Username");
or:
api.getPlayerIds();