BlockCore is a powerful script wrapper for the Bedrock Scripting API. This wrapper helps you maintain clean code and simplifies interactions with the Bedrock Scripting API. It includes a variety of classes, managers, and utilities for your development needs.
View Repository
·
Report a Bug
·
Request a Feature
Looking for documentation? Check out the documentation folder.
To install the BlockCore addon, follow these steps:
-
Download the Repository: Download the repository as a ZIP file.
-
Extract the ZIP File: Extract the contents of the downloaded ZIP file and copy the extracted folder.
-
Navigate to the Minecraft Bedrock Directory: Open your Minecraft Bedrock installation directory.
-
Locate the
development_behavior_pack
Folder: Find thedevelopment_behavior_pack
folder within the Minecraft directory and paste the copied folder inside it.
To use the BlockCore addon, follow these steps:
-
Create a New World or Edit an Existing World: You can either create a new world or modify an existing one.
-
Access the Experimental Menu: Navigate to the Experimental menu in the world settings:
-
Enable the
Beta APIs
: Make sure to enable theBeta APIs
option:
NOTE: If you plan to apply any scripting-related modifications to your world, please make a backup copy of your world beforehand. I am not responsible for any issues that may arise!
BlockCore offers a variety of powerful features to enhance your development experience:
- Custom Commands: Easily create and manage custom commands for your addon.
- Event Manager: Handle events efficiently with a dedicated event management system.
- Form Generator (JSON-Based): Generate forms using a simple JSON structure for user interactions.
- Binary Operator: Utilize binary operations for advanced data manipulation.
- Chunk Manager: Manage chunks effectively for optimized performance in your projects.
- Data Collection: Support for both database and collection data management.
- Vector Support (2D & 3D): Work with 2D and 3D vectors for spatial calculations and manipulations.
- Process Interval: Control the timing of processes to ensure smooth execution.
- Development Logger: Keep track of development activities and debug information with a built-in logger.
- Utilities: Access a range of utility functions to simplify common tasks.
We highly recommend using TypeScript
for developing the addon, as BlockCore
is built on top of it. TypeScript provides strong typing, which helps catch errors during development and improves code quality.
-
Clone this repository:
git clone https://github.com/VoxlDevv/BlockCore.git
-
Navigate to the project directory:
cd $DIR/BlockCore
Replace
$DIR
with the path where you cloned the repository. -
Install dependencies:
You can install dependencies using either of the following package managers:
-
NPM:
npm install
-
Bun:
bun install
-
-
Build the code:
You can build the project using either of the following methods:
-
NPM:
npm run build
For development mode, use:
npm run dev
-
Bun:
bun run build
For development mode, use:
bun run dev
-
Make sure you have Node.js and TypeScript installed on your machine to run the above commands successfully.
To create a custom command, follow these steps:
-
Create a New File: Navigate to the BlockCore Plugin directory, open the Custom Commands folder, and create a new file named
some.ts
(or any name you prefer).// some.ts import { CommandBuilder, CommandRegister } from "../block-core"; CommandBuilder.Build({ register: new CommandRegister().setName("some"), // Registering a new command called "some". onExecute: ({ sender }) => { // This callback is triggered when the player executes the "some" command. sender.sendMessage("Hello There!"); // Send a message to the player after the command is executed. }, });
-
Import the Command: To make the command available in the system, import the file into the
Execute.ts
file located in the Custom Commands folder. Add the file entry as follows:const command_entry = [ // ... Existing entries // Add your own file entry (without file extensions) "./some", ];
By following these steps, you can successfully create and register a custom command in BlockCore.
To create a custom plugin, follow these steps:
-
Create a New Folder: Navigate to the BlockCore Plugin directory and create a new folder named
MyPlugin
(or any name you prefer). -
Create an Entry File: Inside your new plugin folder (e.g.,
MyPlugin
), create an entry file calledExecute.ts
. You can add any necessary imports or code to this file. -
Register the Plugin: Locate the
user_plugin_loader.ts
file in the root directory of the Plugin. To register your plugin, edit theplugin_path_name
array as follows:const plugin_path_name = [ "Better Ranks", "Custom Commands", // Your Plugin "MyPlugin", ];
This will read the folder name specified in
plugin_path_name
and execute the corresponding entry file (Execute.ts
).
For more detailed information and documentation, please refer to the documentation.
You can configure the project by modifying the config.ts
or config.js
file. Here are some of the key configurations:
enable_custom_command
: Enable or disable custom commands.custom_command_prefixes
: Set the prefixes for custom commands.
Here are some of the available commands you can use:
help
: Provides a list of commands and their descriptions.sethome <name>
: Sets a home location with the specified name.delhome <name>
: Deletes the home location with the specified name.home <name>
: Teleports to the specified home location.
This project is licensed under the MIT License - see the LICENSE file for details.