arijplay_zextra

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:

  1. Launch the firework normally.
  2. Detect the selected image stored in the firework item.
  3. When the firework reaches the configured height, display the image in the sky.
  4. Convert the image into a Minecraft-compatible visual representation.
  5. Preserve the image's aspect ratio.
  6. Display transparent pixels as invisible.
  7. Display colored pixels using suitable Minecraft particles/display rendering.
  8. The image should look like a large picture floating in the sky.
  9. After the configured duration, remove the image automatically.
  10. 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:

yaml
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.

Kodari AI
KodariAug 15 at 3:17 am 2
ImageFirework
ImageFirework is a Paper 1.21.x plugin that renders PNG/JPG images in the Minecraft sky via custom fireworks. Administrators place images in the plugin folder, then use commands to give players special firework items. When launched, the firework displays the image as a large 2D visual using efficient particle-based rendering. Features include configurable image scaling, resolution limits, display duration, render distance, and automatic cleanup. Includes full command system with tab completion, permission-based access, async image loading, and performance optimizations for multiplayer servers.
  • Build a Paper 1.21.x Maven project with Java 21 and a runtime-created images directory.

  • Implement asynchronous image discovery, validation, aspect-ratio-preserving processing, transparency handling, and pixel limits.

  • Add the item/PDC system, commands, permissions, tab completion, and configurable messages.

  • Render images with nearby-player dust particles, track firework height, enforce duration/distance/concurrency limits, and clean up on disable.

Created the complete ImageFirework Paper 1.21.x plugin project.

Included:

  • Maven build targeting Java 21

  • ImageFirework.jar output configuration

  • PNG/JPG image loading from plugins/ImageFirework/images/

  • Asynchronous image processing

  • Aspect-ratio-preserving resizing

  • Transparency support

  • Pixel limits and particle-density controls

  • PersistentDataContainer-based image item metadata

  • Firework launching and height tracking

  • Nearby-player particle rendering

  • Automatic display expiration and cleanup

  • /imagefirework give

  • /imagefirework list

  • /imagefirework reload

  • /imagefirework help

  • Permissions and tab completion

  • Configurable messages and rendering settings

  • README installation instructions

  • Automatic creation of the image directory and default configuration

Build with:

Shell
mvn clean package

The resulting file will be:

Plain Text
target/ImageFirework.jar

Place it in the server’s plugins/ directory, start the server, add images to:

Plain Text
plugins/ImageFirework/images/

Then reload with:

Plain Text
/imagefirework reload
Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
17 1,056
src/main/java/com/kodraai/imagefirework/ImageFireworkPlugin.java
package com.kodraai.imagefirework;

import com.kodraai.imagefirework.command.ImageFireworkCommand;
import com.kodraai.imagefirework.command.ImageFireworkTabCompleter;
import com.kodraai.imagefirework.config.ConfigurationManager;
import com.kodraai.imagefirework.firework.FireworkManager;
import com.kodraai.imagefirework.image.ImageManager;
import com.kodraai.imagefirework.item.ItemManager;
import com.kodraai.imagefirework.render.ImageRenderer;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

public final class ImageFireworkPlugin extends JavaPlugin {
    private ConfigurationManager configurationManager;
    private ImageManager imageManager;
    private ItemManager itemManager;
    private ImageRenderer imageRenderer;
    private FireworkManager fireworkManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        configurationManager = new ConfigurationManager(this);
        File imageFolder = new File(getDataFolder(), configurationManager.imageFolder());
        if (!imageFolder.exists() && !imageFolder.mkdirs()) {
            getLogger().warning("Could not create image directory: " + imageFolder.getAbsolutePath());
        }

        imageManager = new ImageManager(this, configurationManager);
        itemManager = new ItemManager(this, configurationManager);
        imageRenderer = new ImageRenderer(this, configurationManager);
        fireworkManager = new FireworkManager(this, configurationManager, imageManager, itemManager, imageRenderer);

        Bukkit.getPluginManager().registerEvents(fireworkManager, this);
        ImageFireworkCommand command = new ImageFireworkCommand(this, configurationManager, imageManager, itemManager, imageRenderer);
        getCommand("imagefirework").setExecutor(command);
        getCommand("imagefirework").setTabCompleter(new ImageFireworkTabCompleter(imageManager));

        imageRenderer.start();
        imageManager.reloadAsync(result -> getLogger().info("Loaded " + result.count() + " image(s)."));
    }

    @Override
    public void onDisable() {
        if (fireworkManager != null) {
            fireworkManager.shutdown();
        }
        if (imageRenderer != null) {
            imageRenderer.shutdown();
        }
    }

    public ConfigurationManager configuration() {
        return configurationManager;
    }

    public ImageManager images() {
        return imageManager;
    }
}