Bloxdhub

Introduction to Bloxd API

5 min read Updated Dec 2025

Welcome to the Bloxd.io API documentation. This guide covers how to create custom game modes, mods, and interactive experiences using the Bloxd scripting system. You can run JavaScript that interacts with the game API.

Community Documentation

This is not official documentation. It's meant to be an additional resource to help developers. Information may occasionally be out-of-date.

Work in Progress

This documentation currently covers about 45-50% of the Bloxd API. We're actively adding more sections and examples. Any feedback or suggestions would be greatly appreciated!

Ways to Run Code

World Code

Press F8 to access. Runs when callbacks are triggered. Supports all callbacks. Limited to 16,000 characters.

Code Blocks

Found in creative menu. Runs when clicked or triggered by adjacent "press to code" board. Cannot use callbacks. 16,000 char limit each.

Code Boards

Begin text with "press to code" to run JavaScript on right-click. Limited text space - use Code Blocks for longer code.

What is World Code?

World Code is the main way to write game logic. Press F8 to open the World Code editor. Only world owners can edit it.

World Code editor popup The World Code editor popup (opened with F8)

What are Code Blocks?

Code Blocks are physical blocks you can place in your world. Find them in the creative menu. Right-click to open the code editor.

Code Block placed in world A Code Block placed in the world

When you right-click a Code Block, you'll see the code editor. Notice the "World Code" button - this is another way to access World Code!

Code Block popup with World Code button The Code Block editor - red arrows show the World Code button

Key Differences

FeatureWorld CodeCode BlocksBoards
Callbacks✓ Yes✗ No✗ No
TriggerCallback eventsClick/adjacent boardRight-click
Char Limit16,00016,000 eachSmall
AccessF8 keyCreative menuPlace sign
myId variablenullPlayer who clickedPlayer who clicked
thisPos variablenullBlock positionBoard position

Global Variables

  • myId - Player ID of who ran the code (null in World Code)
  • thisPos - Position of the code block/board (null in World Code)
  • api - Global object with all API methods

Useful Tips

  • Use api.log() or console.log() for debugging
  • Use Date.now() or api.now() for timestamps
  • Comments work: // comment and /* comment */
  • Variables declared with var are shared across World Code, Code Blocks, and Boards

Welcome to Bloxdhub

The ultimate social platform for Bloxd.io players

More coming soon
I agree to the and

Start typing to search...