# Lazuli Components
Add some useful custom components in Minecraft Bedrock Edition.

## Document
- [components doc](https://lazuli.codeberg.page/components)

## Usage
### Use javascript bundler 
First, install the npm pack:
~~~
npm install lazuli-component
~~~

Then, registry the custom component with the component's registry method, such as:

~~~ts
import { CustomWeaponComponent } from "lazuli-components";

CustomWeaponComponent.registry();
~~~

After registied it, add following code your item JSON file:

~~~json
"minecraft:custom_components": ["lazuli:custom_weapon"]
~~~

Finally, use the bundler to pack your script file.

If you use esbuild, add `--bundle` to the pack command.

### Use javascript file
Download `components.js` from the release attachment, copy this file to the scripts directory of your behavior pack.

Finally, add following code to the entrypoint script:

~~~ts
import "./components.js" // The path to the 'components.js' in your behavior pack
~~~