ChatImage - Send images in Minecraft! icon

ChatImage - Send images in Minecraft! -----

A simple plugin to send pictures in chat. — Supports DiscordSRV and PlaceholderAPI.



ChatImage
Send images in Minecraft!

[​IMG]


Features
Hover Images
Send images without them taking up space in chat! Players can type /hideimages or it can be enabled by default in the configuration file.

[​IMG]


Partial-transparency support

Send images with mixed levels of transparency!

[​IMG]
[​IMG]


Rendering Options
Smooth rendering looks better for almost all images, however, simple rendering may look better on simple images. There is no discernable difference in the speed of these options.

[​IMG]
[​IMG]


DiscordSRV and EssentialsDiscord Support
Images sent from Discord will render in Minecraft chat!



PlaceholderAPI Support
Insert images anywhere with the %chatimage_image% placeholder! This can be used to put images on item lore.

See Placeholder Usage below for more details.


NSFW Content Filtration

You can filter out explicit content and bad words in 27 different languages! To utilize this, you can enable it in the config. For explicit content filtering, you will need to paste an API key. This can be obtained for free by simply providing an email address here. You can scan up to 10,000 images per month on the free plan. Duplicated images cache within the plugin to save you some usage on your key.

If an image is ever classified incorrectly, please make note of the URL and send it here.



BungeeCord and Velocity Support

This plugin will work exactly the same for Spigot, BungeeCord, and Velocity!
Note: Only install this plugin on BungeeCord/Velocity if your server has some form of global-chat. Otherwise, install the plugin on each Spigot server.


Videos





Configuration
Code (YAML):

# ============================================= #
#            ChatImage Configuration            #
#              By: ChickenSaysBak               #
#                                               #
# To reload, use /chatimage reload              #
#                                               #
# Permissions:                                  #
# - chatimage.use (to render images)            #
# - chatimage.admin (to use /chatimage)         #
# ============================================= #


# IMAGE SETTINGS #

# Uses a more visually pleasing method of rendering images.
# This is nearly just as fast as alternative rendering.
smooth_render
: true

# Gets rid of excessive blank space along edges.
trim_transparency
: true

# Maximum dimensions for an image. The maximum for default Minecraft chat settings is 35 x 20.
# See HIDDEN IMAGE SETTINGS for changing the dimensions of hidden images.
max_width
: 35
max_height
: 20


# COOLDOWN SETTINGS #

# Sets how long (in seconds) someone must wait before another image will render.
cooldown
: 3

# Cooldown will start from 0 if an image URL is sent (as opposed to it starting when the image itself renders).
# If enabled, this lengthens the cooldown if the user is repeatedly sending a URL. This can help against avid spammers.
strict_cooldown
: false


# HIDDEN IMAGE SETTINGS #

# When a player runs /hideimages, images sent in chat are minimized, and they can be viewed by hovering.
# Hidden images that are wide will appear smaller than normal.
hidden_images
:

  # Hides images by default. Players can individually override this with /showimages.
  # If enabled, consider reducing the cooldown since this option already reduces line spam.
  auto_hide
: false

  # Maximum dimensions for hidden images only.
  # If you increase the width, beware that you risk creating broken images for users on a smaller window size or bigger GUI scale.
  # Conversely, on a smaller GUI scale, you can render way larger images, but there's no way to know who's using what scale.
  # 23 x 24 is a safe default for the standard 854 x 480 window or larger.
  # If you don't mind potentially breaking images for some users, you can increase it to 26 x 27 for full-screen users.
  max_width
: 23
  max_height
: 24


# FILTRATION SETTINGS #

bad_words
:

  # Prevents an image from rendering if bad words are found. Does not apply to '/chatimage send'
  # This will impact speed by a couple seconds. Duplicates cache within the plugin to increase speed.
  enabled
: false

  # If an image contains bad words, the entire message with the link will not be sent.
  # This includes messages from people that do not have permission to render images.
  remove_message
: false

  # Specify words that should be allowed. Example:
  # exclusions: ["word", "word", "word"]
  exclusions
: [ ]

explicit_content
:

  # You can obtain an api key for free here: https://moderatecontent.com/signup
  # All you need is to submit an email address, and you will receive one with no additional account setup required.
  # With this, you can scan up to 10,000 images a month. If you need more, upgrades are available.
  # To check your server's usage stats, go here: https://client.moderatecontent.com/
  # If you're running a public server, please don't test images in chat. You can test them using this (add key and url):
  # https://api.moderatecontent.com/moderate/?key=API_KEY_HERE&url=URL_HERE
  api_key
: ""

  # YOU MUST HAVE AN API KEY TO USE THIS FEATURE.
  # Prevents an image from rendering if explicit content is found. Does not apply to '/chatimage send'
  # This will impact speed by a couple seconds. Duplicates cache within the plugin to increase speed.
  enabled
: false

  # If an image contains explicit content, the entire message with the link will not be sent.
  # NOTE: This includes messages from people that do not have permission to render images. Any images scanned will count toward your monthly limit!
  remove_message
: false


# GENERAL SETTINGS #

# The default language to use if a player's client language is unsupported.
# You can add languages in the messages folder. Please consider sharing these on the plugin's GitHub or SpigotMC page!
# If adding a language, name the file with a valid in-game language code: https://minecraft.wiki/w/Language#Languages
language_default
: en_us

# Prints extra messages to console to help find the source of issues
debug
: false
 


Permissions
chatimage.use
This is required to send images using URLs. It could make for a nice donor perk!

chatimage.admin

This is required to use the /chatimage command. See below ↓


Commands
/hideimages
This can be used by all players. If enabled, images will be minimized and require the player to hover to view the image.

/showimages

Reverses /hideimages.
/chatimage reload
Type this after making any changes to the config file.

/chatimage send <player>|all <url> [smooth] [trim] [width] [height] [text]

Send images to specific players or all players. The options at the end will use the config values if they are not specified. Additionally, you can append text to display to the right of the image. This supports color codes, line breaks (\n), and placeholders provided by PlaceholderAPI. This command could have a variety of creative uses!

[​IMG]
Code (Text):
/chatimage send ChickenSaysBak https://images.vexels.com/media/users/3/220947/isolated/preview/e22f7e6fdc024de159849b35e2a82c7a-skull-mouth-open-illustration.png true true 35 20 \n\n\n\n\n\n\n\n\n &r &r &r &r &r &r &r &4&lYOU\n &r &r &r &r &r &r &4&lDIED!!

/chatimage save <name> <url> [smooth] [trim] [width] [height]

Similar to the above command, but saves the textual image to the plugin folder for later use.

/chatimage delete <name>

Deletes a saved image.

/chatimage send <player>|all <name> [text]

Sends a saved image to a specific player or all players. Text can be appended at the end just like the other send sub-command above. Sending a saved image is much faster than sending from a URL because retrieving the image over the internet is the longest step in the process.



Placeholder Usage
ChatImage provides PlaceholderAPI with a custom placeholder for inserting images anywhere. You simply need the PlaceholderAPI plugin installed along with ChatImage and it will be available. To use it, refer to the syntax below:

%chatimage_image: <name> [text]%
%chatimage_image: <url> [smooth] [trim] [width] [height] [text]%

The parameters are identical to the /chatimage send command. You can use other placeholders inside the text parameter, but you must use curly braces instead of percent signs since the placeholder exists inside another placeholder. For example:
%chatimage_image: heart \n Your Health \n {player_health}%

Note: It is recommended to use saved images for placeholders instead of URLs because retrieving images from the internet will lag the PlaceholderAPI plugin and any plugins using the placeholder.



Developer API
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
}


Servers Using This Plugin

royalmc.net
[​IMG]

[​IMG]

[​IMG]


Tip
If you're having trouble sending a particular image, try uploading it to Imgbb, Gyazo, or even Discord. Just be sure to copy the direct image link ending with .png, .jpg, etc.


Please feel free to contact me if you have any questions, issues, or suggestions!
Resource Information
Author:
----------
Total Downloads: 4,116
First Release: Aug 30, 2021
Last Update: Aug 4, 2024
Category: ---------------
All-Time Rating:
18 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings