Create a complete Minecraft Java plugin named ImageFirework for Paper 1.21.x.
The plugin should work similarly to an image-firework plugin where an administrator can place an image file inside the plugin folder, then give players a special firework item through a command. When the player uses/launches that firework, the selected image should appear in the Minecraft sky.
Core concept
Plugin folder:
plugins/ImageFirework/images/
Administrators can put PNG/JPG images inside this folder, for example:
* india.png * logo.png * rydex.png
The plugin must automatically detect/load these images.
Commands
Implement:
/imagefirework give <player> <image> [amount]
Example:
/imagefirework give Arij india 1
This gives the player a special Image Firework containing the selected image.
/imagefirework list
Shows all available images from the images folder.
/imagefirework reload
Reloads the image files and configuration without restarting the server.
/imagefirework help
Shows all commands.
Add tab completion for player names, image names and commands.
Firework behavior
When the player uses/launches the Image Firework:
- Launch the firework normally.
- Detect the selected image stored in the firework item.
- When the firework reaches the configured height, display the image in the sky.
- Convert the image into a Minecraft-compatible visual representation.
- Preserve the image's aspect ratio.
- Display transparent pixels as invisible.
- Display colored pixels using suitable Minecraft particles/display rendering.
- The image should look like a large picture floating in the sky.
- After the configured duration, remove the image automatically.
- Prevent excessive lag by limiting image resolution and particle count.
Image processing
Support PNG and JPG.
For PNG:
* Read transparency/alpha. * Ignore fully transparent pixels. * Resize large images automatically. * Keep the original aspect ratio. * Convert pixels to an efficient color representation.
Add configuration options:
max-image-width
max-image-height
pixel-step
image-scale
display-duration
display-distance
particle-density
firework-height
cleanup-delay
Use an efficient rendering system so a large image does not freeze the server.
Rendering
Do NOT attempt to make vanilla fireworks natively render arbitrary PNG images because Minecraft fireworks cannot directly display PNG files.
Instead, implement an efficient custom renderer using appropriate Paper/Minecraft APIs such as particles, display entities, or packet-based rendering where suitable.
Prefer the most performance-friendly method for Paper 1.21.x.
The rendered image should appear as a large 2D image facing the players.
Allow configuration for:
* image scale * rotation * height * duration * render distance * pixel spacing * maximum pixels
The image should be visible to nearby players but should not create unnecessary server load for players far away.
Item
The Image Firework item should look like a normal firework but have a custom name such as:
&b&lImage Firework
Lore:
&7Image: &f<image-name>
&7Right-click to launch
Store the selected image name safely inside the item's PersistentDataContainer so the plugin knows which image to render.
Do NOT depend on the item display name to identify the image.
Permissions
Add:
imagefirework.admin
For:
* give * reload * list
Add:
imagefirework.use
For launching Image Fireworks.
Configuration
Create a clean config.yml with comments explaining every option.
Example structure:
settings:
max-image-width: 64
max-image-height: 64
pixel-step: 1
image-scale: 0.12
display-duration: 100
display-distance: 64
particle-density: 1.0
firework-height: 25
cleanup-delay: 5
item:
material: FIREWORK_ROCKET
name: "&b&lImage Firework"
lore:
- "&7Image: &f%image%"
- "&7Right-click to launch"
images:
folder: "images"
Safety/performance
The plugin must be optimized for multiplayer servers.
Implement:
* Maximum image resolution. * Maximum simultaneous image displays. * Maximum rendered pixels. * Automatic cleanup. * Async image loading where safe. * Never perform heavy image processing on the main server thread. * Avoid memory leaks. * Cancel rendering when the player moves too far away if appropriate. * Clean all active renderers when the plugin disables. * Validate image files before loading them. * Handle corrupted/unsupported images gracefully. * Do not crash the server because of a bad image.
Error messages
Add configurable messages for:
* Image not found. * Player not found. * No permission. * Invalid command. * Image loaded successfully. * Reload completed. * Invalid image format. * Image too large. * Firework launched.
Support Minecraft color codes using &.
Plugin structure
Create a professional Maven/Gradle project with clean packages, for example:
com.kodraai.imagefirework
Classes should be separated logically:
* Main plugin class * Command handler * Tab completer * Image manager * Image loader * Image processor * Firework manager * Image renderer * Item manager * Configuration manager * Permission manager * Utility classes
Use clean, maintainable Java code.
plugin.yml
Create a complete plugin.yml containing:
* plugin name * version * main class * api-version * commands * permissions * descriptions * aliases if useful
Installation
The final project must compile into:
ImageFirework.jar
After placing the JAR in:
plugins/
the plugin should automatically create:
plugins/ImageFirework/images/
and:
plugins/ImageFirework/config.yml
Give clear installation instructions.
Compatibility
Target:
Paper 1.21.x
Use modern Paper APIs where possible.
Do not use outdated/deprecated APIs unnecessarily.
If a feature requires NMS or packet-level code, isolate that code so future Minecraft versions can be updated easily.
Final requirement
Generate the COMPLETE working source code, not pseudocode.
Generate every required file:
* pom.xml or build.gradle * plugin.yml * config.yml * all Java classes * README.md * example image-folder structure
The final result must compile successfully and produce a functional ImageFirework.jar.
The plugin should feel like a polished production-ready alternative to ImageFirework Reborn, with the key feature being:
Put an image inside plugins/ImageFirework/images/ → use /imagefirework give <player> <image> → launch the special firework → that exact image appears large in the Minecraft sky.