Skip to content

Commit

Permalink
Add programmatic use case
Browse files Browse the repository at this point in the history
  • Loading branch information
noyzys authored Nov 16, 2024
1 parent c17ac90 commit 37f46b3
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,28 @@ implementation("dev.shiza:honey:2.0.0")

A showcase of how to use *honey*, can be found in [honey-test-plugin](honey-test-plugin) module.

![test-plugin showcase](assets/image.png)
```java
/* for titles::audience */
dispatcher.createTitle()
.recipient(event.getPlayer())
.title(it -> it.template("Hello!"))
.subtitle(it -> it.template("It is a pleasure to see you there {{player.getName}}")
.variable("player", event.getPlayer()))
.times(2, 4, 2)
.dispatch();

/* for chat::audience */
dispatcher.createChat()
.recipient(Bukkit.getServer())
.template("{{player.getName}} has joined the server!")
.variable("player", event.getPlayer())
.dispatch();

/* for actionbar::audience */
dispatcher.createActionBar()
.recipient(event.getPlayer())
.template("Honey is great, isn't it?")
.dispatch();
```

![test-plugin showcase](assets/image.png)

0 comments on commit 37f46b3

Please sign in to comment.