# LoreEditor
Packet-level item lore modification for Spigot and its forks.
## ⚠️Warning
This plugin only supports versions listed in the [Modrinth page](https://modrinth.com/plugin/loreeditor). Other versions will NOT work.
Check your server version before downloading the plugin!
## ✨Features
- Add lore lines to items, without affecting an actual item.
## 📥Installation
You can download the latest version of LoreEditor from the [Modrinth](https://modrinth.com/plugin/loreeditor) and then place it in your `plugins` folder.
## 🔧Developer API
LoreEditor provides a simple API for developers to use.
### 💻Dependency
#### 📝plugin.yml
To use LoreEditor in your plugin, you need to add the following to your `plugin.yml`:
```yaml
depend: [LoreEditor]
```
#### Maven
If you are using Maven, add the following to your `` tag in `pom.xml`:
```xml
azisaba
https://repo.azisaba.net/repository/maven-public/
```
And add the following to your `` tag in `pom.xml`:
```xml
net.azisaba.loreeditor
api
[version]
provided
all
```
#### Gradle (Kotlin DSL)
```kotlin
repositories {
maven("https://repo.azisaba.net/repository/maven-public/")
}
dependencies {
compileOnly("net.azisaba.loreeditor:api:[version]:all") // don't forget "all" classifier
}
```
### ⌨️Usage
#### Add lore lines
```java
import net.azisaba.loreeditor.api.event.EventBus;
import net.azisaba.loreeditor.api.event.ItemEvent;
import net.azisaba.loreeditor.libs.net.kyori.adventure.text.Component;
import org.bukkit.plugin.java.JavaPlugin;
public class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
// 在 LoreEditor 中,我们使用 EventBus 来监听事件。
// 这个例子为每一件物品添加 "Hello, world!" 到 lore 中。
// 请注意,阻塞操作(例如文件 IO 和数据库操作)不应该在事件监听器中执行。
EventBus.INSTANCE.register(this, ItemEvent.class, 0, e -> {
e.addLore(Component.text("Hello, world!"));
// 更多 lore 行...
});
}
// 我们不需要取消注册监听器,因为 LoreEditor 会处理它。
}
```
## 📜License
LoreEditor is licensed under the [GNU General Public License v3.0](LICENSE).