Skip to content

Commit aef8f8a

Browse files
committed
development support
1 parent 9176bcc commit aef8f8a

4 files changed

Lines changed: 259 additions & 52 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
**/*/test.ts

README.md

Lines changed: 243 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,259 @@
1-
# Project Overview
1+
<div align="center">
2+
<img src="https://i.imgur.com/SC3cMPU_d.webp?maxwidth=760&fidelity=grand" alt="Thumbnail">
23

3-
This project is a Minecraft Bedrock Addon that enhances gameplay by providing custom commands, form generation, and various utilities. The codebase is structured to facilitate easy management and extension of commands and forms.
4+
<p align="center">
5+
BlockCore is a Powerfull Script Wrapper of Bedrock Scripting API, This Wrapper will help you keep your code clean and make it easier to interact with the Bedrock Scripting API, while including a lot of Classes, Manager and Utilities for you to use!
6+
</br>
7+
</br>
8+
<a href="https://github.com/VoxlDevv/BlockCore">Repository</a>
9+
·
10+
<a href="https://github.com/VoxlDevv/BlockCore/issues">Bug Report</a>
11+
·
12+
<a href="https://github.com/VoxlDevv/BlockCore/issues">Feature Request</a>
413

5-
# Current Version
6-
- **Module**: 1.0.0-stable
7-
- **Supported MC Version**: 1.21.30
14+
</p>
815

9-
## Features
16+
---
17+
18+
[![MIT License](https://img.shields.io/github/license/VoxlDevv/BlockCore?style=for-the-badge&color=yellow)](LICENSE)
19+
[![Discord Server](https://img.shields.io/discord/1125432627382460498?color=blue&label=Discord&style=for-the-badge)](https://discord.gg/ffZHPHRBhY)
20+
[![GitHub Releases](https://img.shields.io/github/downloads/VoxlDevv/BlockCore/total?style=for-the-badge&color=orange)
21+
](https://github.com/VoxlDevv/BlockCore/releases/latest)
22+
23+
---
1024

11-
- **Custom Commands**: Allows players to execute commands with various functionalities, such as setting and teleporting to homes, viewing help information, and checking the module version.
12-
- **Form Generation**: Provides a framework for creating and displaying different types of forms to players, including action forms, modal forms, and message forms.
13-
- **Utilities**: Includes various utility classes for formatting, validation, and tick conversion, enhancing the overall functionality of the addon.
25+
</div>
1426

15-
## Directory Structure
27+
## Table of Contents
1628

17-
- `src/`: Contains the main source code for the addon.
18-
- `_Core/`: Core functionalities and utilities.
19-
- `Managers/`: Manages commands, events, and world interactions.
20-
- `Operators/`:
21-
- `Processors/`: Load events.
22-
- `Systems/`: Contains various systems like data collection and vector operations.
23-
- `Utilities/`: Utility classes for formatting, validation, and tick conversion.
24-
- `@types/`: Type definitions for TypeScript.
25-
- `Plugins/`: Contains custom commands and configurations.
26-
- `Custom Commands/`: Specific commands that players can use in the game.
27-
- `Better Ranks/`: Manages player ranks and their display.
29+
- [Installation](#installation)
30+
- [Usage](#usage)
31+
- [Features](#features)
32+
- [Development](#development)
33+
- [Plugin Example](#plugin-example)
34+
- [Configuration](#configuration)
35+
- [Commands](#commands)
36+
- [License](#license)
37+
38+
---
2839

2940
## Installation
3041

31-
1. Clone the repository to your local machine.
32-
2. Place the addon in the appropriate addons directory of your Minecraft Bedrock (Development Behavior Pack).
33-
3. Done.
42+
To install the BlockCore addon, follow these steps:
43+
44+
1. **Download the Repository**:
45+
Download the repository as a ZIP file.
46+
47+
2. **Extract the ZIP File**:
48+
Extract the contents of the downloaded ZIP file and copy the extracted folder.
49+
50+
3. **Navigate to the Minecraft Bedrock Directory**:
51+
Open your Minecraft Bedrock installation directory.
52+
53+
4. **Locate the `development_behavior_pack` Folder**:
54+
Find the `development_behavior_pack` folder within the Minecraft directory and paste the copied folder inside it.
55+
56+
---
57+
58+
## Usage
59+
60+
To use the BlockCore addon, follow these steps:
61+
62+
1. **Create a New World or Edit an Existing World**:
63+
You can either create a new world or modify an existing one.
64+
65+
2. **Access the Experimental Menu**:
66+
Navigate to the Experimental menu in the world settings:
67+
68+
![](https://i.imgur.com/MuZfNrw_d.webp?maxwidth=384&fidelity=grand)
69+
70+
3. **Enable the `Beta APIs`**:
71+
Make sure to enable the `Beta APIs` option:
72+
73+
![](https://i.imgur.com/HrogvBu.png)
74+
75+
**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!_
76+
77+
---
78+
79+
## Features
80+
81+
BlockCore offers a variety of powerful features to enhance your development experience:
82+
83+
1. **Custom Commands**: Easily create and manage custom commands for your addon.
84+
2. **Event Manager**: Handle events efficiently with a dedicated event management system.
85+
3. **Form Generator (JSON-Based)**: Generate forms using a simple JSON structure for user interactions.
86+
4. **Binary Operator**: Utilize binary operations for advanced data manipulation.
87+
5. **Chunk Manager**: Manage chunks effectively for optimized performance in your projects.
88+
6. **Data Collection**: Support for both database and collection data management.
89+
7. **Vector Support (2D & 3D)**: Work with 2D and 3D vectors for spatial calculations and manipulations.
90+
8. **Process Interval**: Control the timing of processes to ensure smooth execution.
91+
9. **Development Logger**: Keep track of development activities and debug information with a built-in logger.
92+
10. **Utilities**: Access a range of utility functions to simplify common tasks.
93+
94+
---
95+
96+
## Development
97+
98+
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.
99+
100+
### Getting Started with TypeScript
101+
102+
1. **Clone this repository**:
103+
104+
```bash
105+
git clone https://github.com/VoxlDevv/BlockCore.git
106+
```
107+
108+
2. **Navigate to the project directory**:
109+
110+
```bash
111+
cd $DIR/BlockCore
112+
```
113+
114+
Replace `$DIR` with the path where you cloned the repository.
115+
116+
3. **Install dependencies**:
117+
118+
You can install dependencies using either of the following package managers:
119+
120+
- **NPM**:
121+
122+
```bash
123+
npm install
124+
```
125+
126+
- **Bun**:
127+
```bash
128+
bun install
129+
```
130+
131+
4. **Build the code**:
132+
133+
You can build the project using either of the following methods:
134+
135+
- **NPM**:
136+
137+
```bash
138+
npm run build
139+
```
140+
141+
For development mode, use:
142+
143+
- (Linux):
144+
```bash
145+
npm run dev:linux
146+
```
147+
- (Windows):
148+
```bash
149+
npm run dev:windows
150+
```
151+
152+
- **Bun**:
153+
154+
```bash
155+
bun run build
156+
```
157+
158+
For development mode, use:
159+
160+
- (Linux):
161+
```bash
162+
bun run dev:linux
163+
```
164+
- (Windows):
165+
```bash
166+
bun run dev:windows
167+
```
168+
169+
Make sure you have Node.js and TypeScript installed on your machine to run the above commands successfully.
170+
171+
---
172+
173+
## Plugin Example
174+
175+
### Custom Command
176+
177+
To create a custom command, follow these steps:
178+
179+
1. **Create a New File**:
180+
Navigate to the BlockCore Plugin directory, open the **Custom Commands** folder, and create a new file named `some.ts` (or any name you prefer).
181+
182+
```typescript
183+
// some.ts
184+
185+
import { CommandBuilder, CommandRegister } from "../block-core";
186+
187+
CommandBuilder.Build({
188+
register: new CommandRegister().setName("some"), // Registering a new command called "some".
189+
onExecute: ({ sender }) => {
190+
// This callback is triggered when the player executes the "some" command.
191+
sender.sendMessage("Hello There!"); // Send a message to the player after the command is executed.
192+
},
193+
});
194+
```
195+
196+
2. **Import the Command**:
197+
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:
198+
199+
```typescript
200+
const command_entry = [
201+
// ... Existing entries
202+
203+
// Add your own file entry (without file extensions)
204+
"./some",
205+
];
206+
```
207+
208+
By following these steps, you can successfully create and register a custom command in BlockCore.
209+
210+
### Custom Plugin
211+
212+
To create a custom plugin, follow these steps:
213+
214+
1. **Create a New Folder**:
215+
Navigate to the BlockCore Plugin directory and create a new folder named `MyPlugin` (or any name you prefer).
216+
217+
2. **Create an Entry File**:
218+
Inside your new plugin folder (e.g., `MyPlugin`), create an entry file called `Execute.ts`. You can add any necessary imports or code to this file.
219+
220+
3. **Register the Plugin**:
221+
Locate the `user_plugin_loader.ts` file in the root directory of the Plugin. To register your plugin, edit the `plugin_path_name` array as follows:
222+
223+
```typescript
224+
const plugin_path_name = [
225+
"Better Ranks",
226+
"Custom Commands",
227+
228+
// Your Plugin
229+
"MyPlugin",
230+
];
231+
```
232+
233+
This will read the folder name specified in `plugin_path_name` and execute the corresponding entry file (`Execute.ts`).
234+
235+
---
236+
237+
## Configuration
238+
239+
You can configure the project by modifying the `config.ts` or `config.js` file. Here are some of the key configurations:
240+
241+
- `enable_custom_command`: Enable or disable custom commands.
242+
- `custom_command_prefixes`: Set the prefixes for custom commands.
243+
244+
---
34245
35-
## Usage ( Default )
246+
## Commands
36247
37-
- Players can use commands prefixed with the specified command prefixes (e.g., `.`, `;`) to interact with the addon.
38-
- Commands include:
39-
- `help`: Displays a list of available commands.
40-
- `version`: Shows the current version of the addon.
41-
- `sethome <name>`: Sets a home location.
42-
- `home <name>`: Teleports to the specified home.
43-
- `delhome <name>`: Deletes the specified home.
248+
Here are some of the available commands you can use:
44249
45-
## Contributing
250+
- `help`: Provides a list of commands and their descriptions.
251+
- `sethome <name>`: Sets a home location with the specified name.
252+
- `delhome <name>`: Deletes the home location with the specified name.
253+
- `home <name>`: Teleports to the specified home location.
46254
47-
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
255+
---
48256
49257
## License
50258
51-
This project is licensed under the [MIT License](./LICENSE). See the LICENSE file for more details.
259+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

bun.lockb

-5.18 KB
Binary file not shown.

package.json

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
{
22
"name": "blockcore",
33
"version": "1.0.0-stable",
4-
"description": "Powerfull Minecraft Bedrock Scripting API Wrapper.",
5-
"module": "scripts/BlockCore/_Core/Processors/BCore.exports.js",
6-
"type": "module",
74
"author": "VoxlDevv",
8-
"license": "MIT",
5+
"type": "module",
6+
"module": "scripts/BlockCore/_Core/Processors/BCore.exports.js",
7+
"dependencies": {
8+
"@minecraft/server": "1.15.0-beta.1.21.31-stable",
9+
"@minecraft/server-gametest": "1.0.0-beta.1.21.31-stable",
10+
"@minecraft/server-ui": "1.4.0-beta.1.21.31-stable"
11+
},
12+
"devDependencies": {
13+
"typescript": "^5.5.4"
14+
},
15+
"description": "Powerfull Minecraft Bedrock Scripting API Wrapper.",
916
"keywords": [
1017
"Minecraft",
1118
"Minecraft-Bedrock",
@@ -14,20 +21,10 @@
1421
"Library",
1522
"Wrapper"
1623
],
24+
"license": "MIT",
1725
"scripts": {
18-
"dev:linux": "rm -r scripts/ && bunx tsc -watch",
19-
"dev:windows": "rmdir /s /q scripts && bunx tsc -watch",
26+
"dev:linux": "rm -r scripts/ && npx tsc -watch",
27+
"dev:windows": "rmdir /s /q scripts && npx tsc -watch",
2028
"build": "tsc"
21-
},
22-
"devDependencies": {
23-
"@types/bun": "latest"
24-
},
25-
"peerDependencies": {
26-
"typescript": "^5.5.4"
27-
},
28-
"dependencies": {
29-
"@minecraft/server": "1.15.0-beta.1.21.31-stable",
30-
"@minecraft/server-gametest": "1.0.0-beta.1.21.31-stable",
31-
"@minecraft/server-ui": "1.4.0-beta.1.21.31-stable"
3229
}
3330
}

0 commit comments

Comments
 (0)