DiscordSRV and EssentialsDiscord Support Images and GIFs sent from Discord will render in Minecraft chat!
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.
Rendering Options Smooth rendering looks better for almost all images, however, simple rendering may look better for flat designs with simple color palettes. There is no discernable difference in the speed of these options.
Partial-transparency support Send images with mixed levels of transparency!
PlaceholderAPI Support Insert images and GIFs 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 any images and GIFs containing explicit content! This feature is off by default, but you can utilize it simply by enabling it in the config. Duplicated content will cache within the plugin to increase processing speed.
BungeeCord and Velocity Support This plugin will work exactly the same for Spigot, BungeeCord, and Velocity! The exception is that Velocity does not support GIFs for now (this will change when dialogs are supported by the Velocity API). 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.
# Sets how long (in seconds) someone must wait before another image or GIF 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
# IMAGE SETTINGS #
# Uses a smoothing effect when rendering images and GIFs. # Looks best on photo-realistic images, but simple rendering may look better for flat graphics. # This is nearly just as fast as simple rendering. smooth_render: true
# Gets rid of excessive blank space along the edges of images. # Does not apply to GIFs. trim_transparency: true
# Maximum dimensions for an image in chat. The maximum for default Minecraft chat settings is 35 x 20. # See HIDDEN IMAGE SETTINGS for changing the dimensions of hidden images. # See GIF SETTINGS for changing the dimensions of GIFs. max_width: 35
max_height: 20
# HIDDEN IMAGE SETTINGS #
# When a player runs /hideimages, images sent in chat are minimized, and they can be viewed by hovering. # Images that are wide will appear smaller than normal when hidden. 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
# GIF SETTINGS # gifs:
# Maximum dimensions for GIFs only. The maximum for default Minecraft settings is 22 x 22. max_width: 22
max_height: 22
# FILTRATION SETTINGS # explicit_content:
# Prevents an image from rendering if explicit content is found. Does not apply to '/chatimage send' # This will impact speed by a couple seconds. Duplicate images cache within the plugin to increase speed. # Feature provided by: https://api4.ai/apis/nsfw 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. # NOTE for Velocity: You will need a plugin like SignedVelocity for this to work correctly on Velocity servers. 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 and GIFs 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 and GIFs to specific players or all players. The options at the end will use the config values if they are not specified. Trim does not apply for GIFs.
Additionally, you can append text to display to the right of the image or above GIFs. This supports color tags, line breaks <br>, and placeholders provided by PlaceholderAPI. This command could have a variety of creative uses!
/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 <br> Your Health <br> {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 respective dependency to your project:
player.
sendMessage(BungeeComponentSerializer.
get().
serialize(media
));
Check if a player is hiding images
Code (Java):
if(ChatImageAPI.
isHidingImages(player.
getUniqueId())){ // player is hiding images }
Tip If you're having trouble sending a particular image, try uploading it to Imgur, Imgbb, Gyazo, or even Discord. Just be sure to copy the direct image link ending with .png, .jpg, .gif, etc.
Please feel free to contact me if you have any questions, issues, or suggestions!