To use this API, add the ChatImage plugin jar to your plugin's build path and add "ChatImage" to the
depend or
softdepend section of your plugin.yml
Creating an image
Code (Java):
TextComponent image
= ChatImageAPI.
createChatImage
(
"http://url.com/example.png"
)
;
You can also use other optional parameters. Unspecified parameters will use config defaults.
Code (Java):
createChatImage
(
String url,
String text,
boolean smooth,
boolean trim,
int width,
int height
)
Sending an image
Spigot
Code (Java):
player.
spigot
(
).
sendMessage
(image
)
;
BungeeCord
Code (Java):
player.
sendMessage
(image
)
;
Velocity
Code (Java):
Component component
= BungeeComponentSerializer.
get
(
).
deserialize
(
new ComponentBuilder
(image
).
create
(
)
)
;
player.
sendMessage
(component
)
;
Check if a player is hiding images
Code (Java):
if
(ChatImageAPI.
isHidingImages
(player.
getUniqueId
(
)
)
)
{
// player is hiding images
}