# Implementing into your code

Once you have added the repo and the dependency into your pom.xml, now it's time to implement it into your code.\
On your main class, import the following static function:

```java
import static com.edwardbelt.edlicense.Main.checkLicense;
```

And now on your onEnable, put the following code. The pluginId can be found in the EdLicense dashboard URL when a plugin is selected or inside your Plugin Settings.

```java
if(!checkLicense("YOUR-PLUGIN-ID", "YOUR-LICENSE-KEY")) {
    Bukkit.getLogger().warning("You are using an invalid license!");
    getServer().getPluginManager().disablePlugin(this);
    return;
}
```

So, if the license is invalid or it has expired or it has reached the maximum amounts of IP addresses it will return false on checkLicense method.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edlicense.com/linking-your-plugin/implementing-into-your-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
