-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExampleClass.java
39 lines (31 loc) · 1.24 KB
/
ExampleClass.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package example;
import me.croabeast.beanslib.utility.TextUtils;
import me.croabeast.beanslib.message.MessageSender;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class ExampleClass {
/*
* If you want to use non-static method to get BeansLib methods.
*/
private final MyPlugin plugin;
public ExampleClass(MyPlugin plugin) {
this.plugin = plugin;
}
public void doSomething() {
new MessageSender(Bukkit.getPlayer("Mark")).send(
"[C] <#D1FF0A>This chat message will be centered and colored</#>",
"[TITLE:3] A good title message<n>Send by: {player}",
"[JSON] {\"text\":\"Click Me!\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/ah\"}}"
"%bossbar:custom-bossbar%"
"[ACTION-BAR] &7Action bar message in &e{playerX}, {playerY}, {playerZ}"
);
}
/*
* If you want to use static method to get BeansLib methods.
*/
public void doStatic() {
MyPlugin.getStaticMyTextClass().doLog("this is some console logs", "a lot of multiple lines");
Player player = Bukkit.getPlayer("Mark");
TextUtils.sendActionBar(player, "<R:1>my rainbow action bar message</R>");
}
}