Yamipa
Yamipa is a Spigot plugin that allows players to place images (even animated!) on any surface in your Minecraft server without having to install any local client mod.
It is designed with performance and compatibility in mind, so even the most low-specs servers should be able to run it.
Installation
Download the JAR file for the latest release and copy it to the "plugins" directory of your Minecraft server as you'll do with any other plugin. That's it!
Requirements
Before installing Yamipa make sure you meet the following requirements:
- CraftBukkit, Spigot or PaperMC 1.16 or higher
- ProtocolLib v5.3.0 or higher
Here are the Minecraft distributions where Yamipa should be able to run:
Minecraft version | CraftBukkit | Spigot | PaperMC |
---|---|---|---|
1.16.x | ✅ | ✅ | ✅ |
1.17 & 1.17.1 | ✅ | ✅ | ✅ |
1.18 & 1.18.x | ✅ | ✅ | ✅ |
1.19 & 1.19.x | ✅ | ✅ | ✅ |
1.20 & 1.20.x | ✅ | ✅ | ✅ |
1.21 & 1.21.x | ✅ | ✅ | ✅ |
Configuration
Yamipa is ready-to-go right out of the box. By default, it creates the following files and directories under the plugins/YamipaPlugin
directory:
cache
: A directory containing cached images to speed up the rendering process. You shouldn't modify its contents.images
: This is the directory where you put the image files you want to place in your Minecraft world.images.dat
: A file holding the list and properties (e.g. coordinates) of all placed images in your server. You shouldn't modify its contents.
You can change the path of these files by creating a config.yml
file in the plugin configuration directory. Here are the default configuration values if you don't specify them:
verbose: false # Set to "true" to enable more verbose logging animate-images: true # Set to "false" to disable GIF support images-path: images # Path to images directory cache-path: cache # Path to cache directory data-path: images.dat # Path to placed images database file allowed-paths: null # Set to a RegExp to limit accessible images to players max-image-dimension: 30 # Maximum width or height in blocks allowed in images
For more information on how to set a different allowed-paths
or max-image-dimension
value per player, see the Player variables section.
The variable allowed-paths
is a regular expression that determines whether a player is allowed to see or download an image file. If the desired path relative to the images directory matches this expression, then the player is allowed to continue.
If allowed-paths
is an empty string ("") or null, then the player can read any image file or download to any path inside the images directory.
This regular expression must follow the syntax used by Java. You can test your expression beforehand using an online tool like regex101. In addition, you can make use of the following special tokens:
#player#
: Player name#uuid#
: Player UUID (with hyphens)
For example, if you want every player in your server to have their own subdirectory for storing files that only they can access, plus a shared public directory, you can use the following allowed-paths
value:
^(private/#player#|public)/
That way, the player "john" can see the image file at "private/john/something.jpg", but "jane" cannot.
IMPORTANT!
Note that these restrictions also apply to other entities like NPCs, command blocks or the server console. However, special tokens will always match in non-player contexts (e.g., "#player#" will be interpreted as ".+").
This library uses bStats to anonymously report the number of installs. If you don't like this, feel free to disable it at any time by adding enabled: false
to the bStats configuration file (it's ok, no hard feelings).
Usage
This plugin adds the following commands:
/image clear <x z world> <r> [<placed-by>]
: Remove all placed images in a radius ofr
blocks around an origin./image describe
: Show detailed information about a placed image./image download <url> <filename>
: Download an image from a URL and place it in the images directory./image give <player> <filename> <amount> <w> [<h>] [<flags>]
: Give image items that can be placed later to a player./image list [<page>]
: List all available files in the images directory./image place <filename> <w> [<h>] [<flags>]
: Place an image of sizew
xh
blocks./image remove
: Remove a placed image from the world without deleting the image file./image top
: List players with the most placed images.
Examples
- Show help
/image
- Download an image from a URL and save it with another name
/image download "https://www.example.com/a/b/c/1234.jpg" imagename.jpg
- Give 10 image items to "TestPlayer" for the "test.jpg" image (3x5 blocks)
/image give TestPlayer test.jpg 10 3 5
- Give 10 image items to "TestPlayer" that will not drop an image item when removed
/image give TestPlayer test.jpg 10 3 5 -DROP
- Start the dialog to place an image with a width of 3 blocks and auto height
/image place imagename.jpg 3
- Start the dialog to place a 3-blocks wide and 2-blocks high image
/image place imagename.jpg 3 2
- Start the dialog to place an image that glows in the dark
/image place imagename.jpg 3 2 +GLOW
- Start the dialog to remove a placed image while keeping the original file
/image remove
- Remove all placed images in a radius of 5 blocks around the spawn
/image clear 0 0 world 5
- Remove all images placed by "EvilPlayer" in a radius of 100 blocks in the nether
/image clear 50 70 world_nether 100 EvilPlayer
- Remove all legacy placed images (without "placed by" metadata)
/image clear 0 0 world 9999999 00000000-0000-0000-0000-000000000000
Permissions
If you want more granular control over the players who can use a particular set of commands, permissions are the way to go!
Yamipa defines the following permissions:
Command | Default | Description |
---|---|---|
yamipa.command.clear |
OPs | To use the /image clear command |
yamipa.command.describe |
OPs | To use the /image describe command |
yamipa.command.download |
OPs | To use the /image download command |
yamipa.command.give |
OPs | To use the /image give download |
yamipa.command.list |
OPs | To use the /image list command |
yamipa.command.place |
OPs | To use the /image place command |
yamipa.command.remove |
OPs | To use the /image remove command |
yamipa.command.remove.own |
OPs | Same as previous, but only for images placed by the same player |
yamipa.command.top |
OPs | To use the /image top command |
yamipa.item.place |
All players | To place image items |
yamipa.item.remove |
All players | To remove image items (that have the REMO flag) |
yamipa.item.remove.own |
All players | Same as previous, but only for images placed by the same player |
Note that permissions work as a tree. This means that if you grant a permission, by default its children will also be granted. For instance, you can grant access to all commands with yamipa.command.*
. Similarly, if you grant the yamipa.command.remove
, the permission yamipa.command.remove.own
will also be granted.
You can change which roles or players are granted these commands by using a permission plugin, such as LuckPerms or GroupManager. Both these plugins have been tested to work with Yamipa, although any similar one should work just fine.
Some permission plugins like LuckPerms allow server operators to assign key-value pairs to entities as if they were permissions. This is useful for granting different capabilities to different players or groups.
Yamipa looks for the following variables which, if found, override the default configuration value that applies to all players:
Variable (key) | Overrides | Description |
---|---|---|
yamipa-allowed-paths |
allowed-paths |
Regular expression that limits which paths in the images directory are accessible |
yamipa-max-image-dimension |
max-image-dimension |
Maximum width or height of images and image items issued by this player or group |
For example, if you want to limit the image size to 5x5 blocks just for the "test" player, you can run this command:
# Using LuckPerms /lp user test meta set yamipa-max-image-dimension 5 # Using GroupManager /manuaddv test yamipa-max-image-dimension 5
Protecting areas
In large servers, letting your players place and remove images wherever they want might not be the most sensible idea. For those cases, Yamipa is compatible with other Bukkit plugins that allow creating and managing world areas. If you have one or more of such plugins, Yamipa will automatically apply permissions accordingly and only let players place or remove images where they can place or remove blocks, no additional configuration required.
The supported plugins are:
Flags
Images from this plugin have a set of boolean attributes called "flags" that modify its behavior. Possible values are:
ANIM
(animatable): Whether an image should be animated or not, useful when you don't want a GIF image to play.REMO
(removable): Whether an image can be removed by any player by left-clicking it.DROP
(droppable): Whether an image drops an image item when is removed by any player.GLOW
(glowing): Whether an image glows in the dark (only works on Minecraft 1.17 and above).
By default, images placed with the "/image place" command only have the ANIM
flag. Similarly, image items issued with the "/image give" command have ANIM
, REMO
and DROP
flags.
Default flags can be modified through the "flags" argument. To add a flag to the default ones use "+{FLAG_NAME}" (e.g. +GLOW
), and to remove it use "-{FLAG_NAME}" (e.g. -ANIM
). You can modify multiple flags separating them with commas (e.g. +GLOW,-ANIM
).
How does it work?
As you may have already guessed, Minecraft does not support the placing of image files. Yamipa bypasses this limitation by using two built-in features (item frames and maps) to render custom images.
However, because item frames are entities (and these cause a lot of lag in a server), Yamipa does not actually create any entity in your world. Instead, it tricks your players' clients into thinking there's a placed item frame where there isn't by sending crafted network packets.
In the case of animated images (i.e. GIFs), Yamipa sends all animation frames to the player (which takes a decent amount of bandwidth) and then sends a tiny packet telling the client to switch to the next animation step (i.e. map) every few milliseconds.
IMPORTANT!
Because Yamipa stores a cached copy of an image in memory whenever a player is near it just in case it needs to send it again without compromising performance, your server needs to have a bit of spare RAM to handle this.The rule of thumb here is 100K per unique loaded image (1MB for animated images). Unique means if the same image with same dimensions is placed multiple times it only counts as one instance.
License
Yamipa is licensed under the MIT License.
I talked to the support on luckperms and they said this is something that must be supported by Yamipa itself
Hey, sorry for being a noob, but I'm very new to using luckperms. I want the players to only be able to use /image give on themselves, and not be able to run the command on other players, but I have no idea how to set that
Stuck infinitely loading image. Image never gets placed.
Paper 1.20.1-R0.1-SNAPSHOT
YamipaPlugin v1.2.11
ProtocolLib v5.1.1-SNAPSHOT-669
When i place images they are invisible. How do I fix this?
The slashes in the URL's are causing the commands not to fully properly function now I don't know if this is because the plugin has to be on the newest version for this to work I have the plugin set up for one point 19.2 because that is the version that my server is running on but that is the one thing I noticed the problem with the plugin
Hi how can i put gif ?
whatever gif i use it says not valid...
should i use a specific website ?
Very nice and easy to use plugin! Good performance and no trouble using lots of image frames like most other image plugins.
Something I noticed when using the 'image' command is that I got an internal error. But then I used ' images' and it worked. It could be a problem with another image plugin, I was testing a couple.
I also noticed the 'Speed: Not animatable' in the images description. Is this something for the future or is yamipa able to play gif files?
*EDIT* I noticed on the github you have a example of adding a gif file, so I found my answer. It makes the plugin even better than I already thought it was!
In reply to jk82nl:
Thanks for your comment! :)
Could you create an issue here if the internal error message persists so that I can try to fix it?
In reply to jk82nl:
can u paste the example here?
Is there any guidelines to best image pixel resolution to use? per block or multiple blocks?
In reply to SmallSansSerif:
Yamipa renders a 128x128 pixels region per block, so if you want to have a pixel-perfect image (e.g. pixel-art) it's best to create a PNG file with a width/height that is a multiple of 128.
Of course you can have images with any given dimension as the plugin will resize them to fit wherever you place them.
Hi, I have problem when Im trying to place it down /yamipa place example.jpg 1 1
It says: An internal error occured while attempting to perform this command
In reply to NuggetVibin:
Hi! Please visit https://github.com/josemmo/yamipa/issues to create a new issue and paste a full trace of exception that cause the error.
Also include some basic information about your server (OS, software version, etc.) and how to reproduce the bug.
I'm trying to use the command putting an url ending with .jpeg (xxxx/UPLOADED436/5fa9165c477c7.jpeg) but it detects the slash as blank space or something
http://snap.ashampoo.com/w1ppY024qDCHB474aoJXVjLwwJrO2rusmecFe7Cucf5Dc2ACJK1aTGWKQjZM1Oah
In reply to Squoshy:
Yep, that's because the Minecraft console treats ":" as a special character. To fix this, just surround the download URL in quotes.
For example:
/yamipa download "https://example.com/image.jpg" new-name.jpg
In reply to josemmooo:
Thank you!