# Plugins

To create a plugin on LeafMCBE, you have to create a index.js file in `./leaf/plugins/<folder>`

```typescript
import { Plugin } from "../../src/plugins/BasePlugin.js";

class Example extends Plugin {
  constructor() {
    super({
      name: "Example",
      version: [1, 0, 0],
      srvVersion: [1, 19, 50],
    });
  }

  onEnable() {
    this.api.getLogger().info("I am enabled!");
}

export default Example;
```

## FAQ:

### 1. Where `this.api` coming from?

`this` is a instance of class, it exist from every class. is exists `this.api` from the base class Plugin.
