alexsus_real

Create a plugin that i can inport somehow images into the game and use them as a prefix for ranks

Kodari AI
KodariMar 24 at 5:13 pm 14,863 (v2)

I’ll create a plugin that allows you to import images and use them as rank prefixes through Minecraft’s custom font system.

ImagePrefix
A comprehensive image-to-prefix system that converts uploaded images into custom font characters for use as rank prefixes. Features include image importing from URLs or files, automatic resource pack generation with optimized font textures, rank management with image assignments, chat integration, and PlaceholderAPI support. Admins can upload images, assign them to ranks, and players automatically see custom image prefixes in chat through the generated resource pack.

I’ve created ImagePrefix, a comprehensive plugin that allows you to import images and use them as rank prefixes through Minecraft’s custom font system.

How It Works

  1. Import images from URLs or local files - they’re converted to custom Unicode characters

  2. Resource pack generation - automatically creates a Minecraft resource pack with your images as custom font characters

  3. Rank system - assign images and text prefixes to ranks using permissions

  4. Automatic application - players receive the resource pack on join and see custom image prefixes in chat

Commands

  • /ip import <name> <url/path> - Import an image from URL or file path

  • /ip list - View all imported images

  • /ip remove <name> - Remove an image

  • /ip rank create <name> <priority> - Create a rank

  • /ip rank setimage <rank> <image> - Assign an image to a rank

  • /ip rank setprefix <rank> <prefix> - Add text prefix (supports color codes)

  • /ip generate - Generate the resource pack ZIP file

  • /ip reload - Reload configuration

Setup Process

  1. Import images: /ip import vip https://example.com/vip-icon.png

  2. Create ranks: /ip rank create vip 10

  3. Assign images: /ip rank setimage vip vip

  4. Add text prefix: /ip rank setprefix vip &6[VIP]&r

  5. Generate pack: /ip generate

  6. Upload the generated pack.zip to a web server

  7. Update host-url in config.yml with your pack URL

  8. Players with permission imageprefix.rank.vip will see the custom prefix

Features

  • Automatic image resizing and optimization

  • Unicode private use area characters (U+E000-U+F8FF)

  • PlaceholderAPI support (%imageprefix_prefix%, %imageprefix_rank%)

  • Configurable chat format

  • Priority-based rank system

  • Supports PNG images from URLs or local paths

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
14 1,025
src/main/java/com/imageprefix/ImagePrefixPlugin.java
package com.imageprefix;

import com.imageprefix.commands.ImagePrefixCommand;
import com.imageprefix.hooks.PlaceholderAPIHook;
import com.imageprefix.listeners.ChatListener;
import com.imageprefix.listeners.JoinListener;
import com.imageprefix.managers.ConfigManager;
import com.imageprefix.managers.ImageManager;
import com.imageprefix.managers.RankManager;
import com.imageprefix.managers.ResourcePackManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ImagePrefixPlugin extends JavaPlugin {
    
    private ConfigManager configManager;
    private ImageManager imageManager;
    private RankManager rankManager;
    private ResourcePackManager resourcePackManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        configManager = new ConfigManager(this);
        imageManager = new ImageManager(this);
        rankManager = new RankManager(this);
        resourcePackManager = new ResourcePackManager(this);
        
        getCommand("imageprefix").setExecutor(new ImagePrefixCommand(this));
        
        Bukkit.getPluginManager().registerEvents(new JoinListener(this), this);
        if (configManager.isChatEnabled()) {
            Bukkit.getPluginManager().registerEvents(new ChatListener(this), this);
        }
        
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new PlaceholderAPIHook(this).register();
            getLogger().info("PlaceholderAPI hook enabled!");
        }
        
        imageManager.loadImages();
        rankManager.loadRanks();
        
        getLogger().info("ImagePrefix has been enabled!");
    }
    
    @Override
    public void onDisable() {
        imageManager.saveImages();
        rankManager.saveRanks();
        getLogger().info("ImagePrefix has been disabled!");
    }
}