errorx.net

FxHomes — Premium Lightweight Homes Plugin

Create a lightweight, clean and premium Minecraft Homes plugin named FxHomes.

The plugin should be optimized for performance and designed with a smooth GUI experience. Use modern Minecraft GUI handling and make everything configurable wherever practical.

Compatibility

  • Minecraft/Paper: 1.21+
  • Java: modern supported Java version
  • Support Hex Colors, RGB colors, legacy colors and standard Minecraft color codes.
  • Use the exact colors provided in this prompt.
  • All GUI actions should work smoothly without unnecessary console errors.

---

COMMANDS

"/homes"

Open the Homes Dashboard GUI.

"/home"

Open the Homes Dashboard GUI.

"/sethome"

Open the Homes Dashboard GUI.

"/home <no>"

Teleport directly to the specified home number.

Example:

/home 1 /home 2 /home 3

Reload

Provide a reload command:

/fxhomes reload

Permission:

fxhomes.reload

---

HOME SYSTEM

Each player can have multiple numbered homes.

Default:

max-home-per-player: 2

The maximum can be increased using permissions:

fxhomes.limit.1 fxhomes.limit.2 fxhomes.limit.3 ... fxhomes.limit.21

The highest applicable "fxhomes.limit.<number>" permission should determine the player's maximum home limit.

Example:

A player with:

fxhomes.limit.5

can have 5 homes.

A player with:

fxhomes.limit.21

can have 21 homes.

If the player has no limit permission, use:

max-home-per-player: 2

The plugin must never allow a player to create more homes than their configured/permission-based limit.

---

GUI SYSTEM

The Homes Dashboard has 3 pages.

max-page: 3

Each page contains:

Rows: 4 Slots: 0-35

IMPORTANT:

Minecraft inventory slots start from 0, not 1.

The GUI must use:

0-35

---

MAIN GUI

Menu Title

&8☀ Homes | Dashboard [%current_page%/%max_page%]

Examples:

&8☀ Homes | Dashboard [1/3] &8☀ Homes | Dashboard [2/3] &8☀ Homes | Dashboard [3/3]

The "%current_page%" and "%max_page%" placeholders must update automatically.

---

FILLER

Material:

BLACK_STAINED_GLASS_PANE

Display name:

""

Slots:

[0-9] [17-18] [26-33]

Apply the same layout to all 3 pages.

---

AVAILABLE HOME

This represents a home slot which has not yet been created.

Material:

GRAY_BED

Slots:

[10-16]

Display name:

&7&lAVILABLE HOME

Lore:

&7Homes "" &#47B6FFInformation: &fClick here, to create a &fbrand new home slot "" &#FFD800▶ &l&nCLICK&r &#FFD800to Create

When the player clicks this item:

  • Create the home at the player's current location.
  • Save the home location.
  • Replace that GUI slot with the player's active home item.
  • Play the home creation sound.
  • Send the configured home-set message.
  • Do not move the item to another slot.
  • The item must remain in the exact slot where the available home existed.

---

HOME EDITOR / AVAILABLE HOME EDITOR

For an already created home slot, use:

Material:

GRAY_DYE

Slots:

[19-25]

Display name:

&7&lHOME SETTING

Lore:

&7Homes "" &#47B6FFInformation: &fClick here, to create a &fbrand new home slot "" &#FFD800▶ &l&nCLICK&r &#FFD800to Create

When the player creates a home, this available editor slot should be replaced by the active home editor item.

---

ACTIVE HOME

When a home is created, replace the corresponding available-home item with:

Material:

LIGHT_BLUE_BED

IMPORTANT:

The item has no fixed slot.

It must replace the exact slot where the corresponding "available-home" item was located.

Display name:

&#47B6FF&lHOME

Lore:

&7Homes "" &#47B6FFInformation: &fClick here to releporr to &fyour this home location! "" &#FFD800▶ &l&nCLICK&r &#FFD800to Teleport

Left click:

Teleport to this home.

Play the configured click sound.

---

ACTIVE HOME EDITOR

When a home is created, replace the corresponding "home-avilable-editor" item with:

Material:

LIGHT_BLUE_DYE

IMPORTANT:

There is no fixed slot for this item.

It must replace the exact slot where the "home-avilable-editor" item existed.

Display name:

&#47B6FF&lHOME EDITOR

Lore:

&7Homes "" &#47B6FFInformation: &fClick here to teleport or &fdelete your this home! "" &#FFD800▶ &l&lRIGHT CLICK&r &#FFD800to Delete &#FFD800▶ &l&nLEFT CLICK&r &#FFD800to Teleport

Actions:

LEFT CLICK

Teleport to that home.

RIGHT CLICK

Open the Home Delete Confirmation GUI.

The actions shown in the lore must exactly match the actual actions.

---

HOME DELETE CONFIRMATION GUI

File:

gui/home_delete.yml

Menu title:

&8☀ Home | Confirm Delete

Rows:

3

Slots:

0-26

---

CANCEL

Material:

RED_STAINED_GLASS_PANE

Slot:

10

Display name:

&#FF2E2E&lCANCEL

Lore:

&7Homes "" &#FFD800▶ &l&nCLICK&r &#FFD800to Cancel

Clicking it:

  • Close the confirmation GUI.
  • Return to the Homes Dashboard.
  • Do not delete the home.
  • Play click sound.

---

CONFIRM

Material:

LIME_STAINED_GLASS_PANE

Slot:

16

Display name:

&#00FF64&lCONFIRM

Lore:

&7Homes "" &#FFD800▶ &l&nCLICK&r &#FFD800to Confirm

Clicking it:

  • Delete the selected home.
  • Remove its saved location.
  • Play click sound.
  • Send the configured delete message.
  • Return to the Homes Dashboard.

---

NO PERMISSION ITEM

If a player does not have permission to create a particular home slot, display:

Material:

RED_BED

There is no fixed slot.

It must replace the corresponding unavailable home slot.

Display name:

&#FF2E2E&lNO PERM

Lore:

&7Homes "" &#47B6FFInformation: &fYou don't have permission &fto set this home! "" &#FFD800▶ &l&nBUY Rank&r &#FFD800to get perm!

Clicking it:

  • Do not create a home.
  • Play "ENTITY_VILLAGER_NO".
  • Send the configured no-permission message.

---

PAGE NAVIGATION

NEXT PAGE

Material:

LIME_STAINED_GLASS_PANE

Slot:

35

Display name:

&#00FF64&lNEXT PAGE

Lore:

&7Homes "" &#FFD800▶ &l&nCLICK&r &#FFD800to Go

Clicking it opens the next page.

IMPORTANT:

If the player is already on the final page, do not show the Next Page item.

---

PREVIOUS PAGE

Material:

RED_STAINED_GLASS_PANE

Slot:

34

Display name:

&#FF2E2E&lPREVIOUS PAGE

Lore:

&7Homes "" &#FFD800▶ &l&nCLICK&r &#FFD800to Go

Clicking it opens the previous page.

IMPORTANT:

If the player is on page 1, do not show the Previous Page item.

---

3-PAGE SYSTEM

The entire GUI layout must be copied across:

Dashboard.yml page_2.yml page_3.yml

All pages use the same basic layout.

Page 1:

Previous Page: HIDDEN Next Page: VISIBLE

Page 2:

Previous Page: VISIBLE Next Page: VISIBLE

Page 3:

Previous Page: VISIBLE Next Page: HIDDEN

The plugin must preserve each player's home data correctly while switching between pages.

Home slots should remain associated with their numbered home.

---

TELEPORT SYSTEM

Config:

teleport-cooldown: 5

When the player clicks a home to teleport:

Start a configurable countdown.

For example, with:

teleport-cooldown: 5

send:

HOMES ▶ Teleporting in 5.

HOMES ▶ Teleporting in 4.

HOMES ▶ Teleporting in 3.

HOMES ▶ Teleporting in 2.

HOMES ▶ Teleporting in 1.

Use:

%cd-time%

for the remaining countdown time.

The countdown should decrease every second.

After the countdown:

HOMES ▶ Teleported.

Then teleport the player to the saved home location.

If the player moves during the countdown, cancel the teleport.

Do not teleport the player if the countdown was cancelled.

---

MESSAGES

All messages must be inside:

config.yml

Prefix:

prefix: "&#47B6FF&lHOMES &8▶"

Home created:

home-set: "%prefix% &#00FF64You have successfully created the home!"

Home deleted:

home-delete: "%prefix% &fYou have delete the home &#FF541A%home_no%"

Reload:

home-reload: "%prefix% &fConfiguration reloaded"

No permission:

no-perm-to-set: "%prefix% &#FF2E2EYou don't have permission to set this home!"

Teleport countdown:

home-teleporting: "%prefix% &fTeleporting in &#FF541A%cd-time%."

Teleported:

teleported-home: "%prefix% &fTeleported."

Support placeholders:

%prefix% %home_no% %cd-time%

---

SOUNDS

Use the following sounds:

CLICK-SOUND: UI_BUTTON_CLICK HOME-SUCCESFULLY-CRRATE: ENTITY_EXPERIENCE_ORB_PICKUP HOME-NO-PERM-CLICK: ENTITY_VILLAGER_NO

Use "CLICK-SOUND" for normal GUI clicks.

Use "HOME-SUCCESFULLY-CRRATE" when successfully creating a home.

Use "HOME-NO-PERM-CLICK" when clicking a no-permission home slot.

All sounds should be configurable.

---

CONFIG.YML

Create a clean configuration structure similar to:

prefix: "&#47B6FF&lHOMES &8▶"

messages: home-set: "%prefix% &#00FF64You have successfully created the home!" home-delete: "%prefix% &fYou have delete the home &#FF541A%home_no%" home-reload: "%prefix% &fConfiguration reloaded" no-perm-to-set: "%prefix% &#FF2E2EYou don't have permission to set this home!" home-teleporting: "%prefix% &fTeleporting in &#FF541A%cd-time%." teleported-home: "%prefix% &fTeleported."

settings: teleport-cooldown: 5 max-page: 3 max-home-per-player: 2

sounds:

CLICK-SOUND: UI_BUTTON_CLICK HOME-SUCCESFULLY-CRRATE: ENTITY_EXPERIENCE_ORB_PICKUP HOME-NO-PERM-CLICK: ENTITY_VILLAGER_NO

Messages must actually support "%prefix%" replacement.

---

GUI FILES

Create a dedicated GUI folder:

gui/ ├── Dashboard.yml ├── page_2.yml ├── page_3.yml └── home_delete.yml

"config.yml" contains all messages and main settings.

GUI-specific items/layouts should be stored in the GUI files so they can be edited without modifying the plugin JAR.

---

DATA STORAGE

Store each player's homes persistently.

Each home should store:

Home number World X Y Z Yaw Pitch

Home data must survive:

  • Server restart
  • Plugin reload
  • Player disconnect/reconnect

Do not lose home locations.

---

IMPORTANT BEHAVIOR

  1. Home numbers must be consistent.
  2. "/home <no>" must teleport to the exact numbered home.
  3. GUI-created homes must correspond to the correct home number.
  4. Deleting a home must remove its saved location.
  5. Creating a new home after deleting one should reuse an available home slot appropriately.
  6. Do not duplicate homes.
  7. Do not create homes when the player has reached their limit.
  8. Respect "fxhomes.limit.<number>" permissions.
  9. Never show Previous Page on page 1.
  10. Never show Next Page on the final page.
  11. Keep home items in their corresponding GUI slots.
  12. All GUI clicks should be handled safely.
  13. Prevent players from taking GUI items into their inventory.
  14. Prevent shift-click, number-key, drag and double-click exploits.
  15. Close/refresh GUIs safely after home creation/deletion.
  16. Avoid unnecessary database/file operations every tick.
  17. Use efficient persistent storage.
  18. Handle invalid home numbers gracefully.
  19. Handle deleted/unloaded worlds safely.
  20. No console errors during normal GUI usage.

---

COMMAND PERMISSIONS

Provide sensible permissions:

fxhomes.use fxhomes.reload fxhomes.limit.1 fxhomes.limit.2 fxhomes.limit.3 ... fxhomes.limit.21

Use:

fxhomes.use

for:

/homes /home /sethome /home <no>

Use:

fxhomes.reload

for:

/fxhomes reload

---

PREMIUM UI REQUIREMENTS

The GUI should feel like a polished premium server plugin:

  • Clean inventory layout
  • Smooth page navigation
  • Correct item replacement
  • No unnecessary animations
  • No GUI flickering
  • No item duplication
  • Instant GUI refresh after actions
  • Hex/RGB colors rendered correctly
  • Lightweight implementation
  • Minimal server resource usage

The final plugin should be named:

FxHomes

Plugin author:

Fx

Make the code clean, modular, maintainable and production-ready.

Kodari AI
KodariOct 29 at 11:35 am 1
FxHomes
FxHomes is a lightweight, premium Minecraft homes plugin for Paper 1.21+ with a polished GUI dashboard. Players manage up to 21 numbered homes through a 3-page interactive inventory interface with clickable beds for teleporting, creating, and deleting homes. Features configurable teleport cooldowns, permission-based home limits, persistent storage across restarts, hex/RGB color support, and full customization via YAML configuration files. Includes teleport countdown with movement cancellation, safe GUI event handling, and efficient data management for production servers.
  1. Create the FxHomes plugin scaffold, configuration, and three dashboard pages.

  2. Add persistent numbered-home storage, permission limits, commands, and teleport countdowns.

  3. Implement protected dashboard/delete GUIs with configurable items, colors, and sounds.

Created FxHomes with the configurable three-page dashboard, protected create/delete GUIs, persistent numbered homes, /homes, /home, /sethome, and /fxhomes reload.

Home limits use the highest fxhomes.limit.1–.21 permission, falling back to max-home-per-player. GUI home clicks start a movement-cancelled teleport countdown; /home <number> teleports directly. Messages, sounds, colors, and GUI layouts are configurable in config.yml and gui/.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
11 1,122
src/main/java/com/fxhomes/FxHomes.java
package com.fxhomes;

import com.cryptomorin.xseries.XSound;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;

public final class FxHomes extends JavaPlugin implements CommandExecutor {
    private final Map<UUID, TeleportCountdown> teleportCountdowns = new HashMap<>();
    private HomeManager homeManager;
    private HomesGui homesGui;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveGuiResource("gui/Dashboard.yml");
        saveGuiResource("gui/page_2.yml");
        saveGuiResource("gui/page_3.yml");
        saveGuiResource("gui/home_delete.yml");

        homeManager = new HomeManager(this);
        homesGui = new HomesGui(this);
        Bukkit.getPluginManager().registerEvents(homesGui, this);
        for (String commandName : new String[]{"homes", "home", "sethome", "fxhomes"}) {
            PluginCommand command = Objects.requireNonNull(getCommand(commandName), "Missing command " + commandName);
            command.setExecutor(this);
        }
    }

    @Override
    public void onDisable() {
        teleportCountdowns.values().forEach(BukkitRunnable::cancel);
        teleportCountdowns.clear();
    }

    public HomeManager getHomeManager() {
        return homeManager;
    }

    public int maximumHomes(Player player) {
        for (int limit = 21; limit >= 1; limit--) {
            if (player.hasPermission("fxhomes.limit." + limit)) {
                return limit;
            }
        }
        return Math.max(1, Math.min(21, getConfig().getInt("settings.max-home-per-player", 2)));
    }

    public void sendMessage(CommandSender recipient, String key, Map<String, String> replacements) {
        String message = getConfig().getString("messages." + key, "");
        message = message.replace("%prefix%", getConfig().getString("prefix", ""));
        for (Map.Entry<String, String> replacement : replacements.entrySet()) {
            message = message.replace(replacement.getKey(), replacement.getValue());
        }
        recipient.sendMessage(ColorUtil.color(message));
    }

    public void playSound(Player player, String key) {
        String sound = getConfig().getString("sounds." + key, "");
        XSound.matchXSound(sound).ifPresent(parsed -> parsed.play(player));
    }

    public void beginTeleport(Player player, HomeManager.HomeLocation home) {
        World world = Bukkit.getWorld(home.world());
        if (world == null) {
            sendMessage(player, "home-world-unavailable", Map.of());
            return;
        }

        int cooldown = Math.max(0, getConfig().getInt("settings.teleport-cooldown", 5));
        if (cooldown == 0) {
            sendMessage(player, "teleported-home", Map.of());
            player.teleport(homeLocation(home, world));
            return;
        }

        TeleportCountdown previous = teleportCountdowns.remove(player.getUniqueId());
        if (previous != null) {
            previous.cancel();
        }

        TeleportCountdown countdown = new TeleportCountdown(player, home, player.getLocation().clone(), cooldown);
        teleportCountdowns.put(player.getUniqueId(), countdown);
        sendMessage(player, "home-teleporting", Map.of("%cd-time%", Integer.toString(cooldown)));
        countdown.runTaskTimer(this, 20L, 20L);
    }

    void cancelTeleport(UUID playerId) {
        TeleportCountdown countdown = teleportCountdowns.remove(playerId);
        if (countdown != null) {
            countdown.cancel();
        }
    }

    private Location homeLocation(HomeManager.HomeLocation home, World world) {
        return new Location(world, home.x(), home.y(), home.z(), home.yaw(), home.pitch());
    }

    private void saveGuiResource(String path) {
        File file = new File(getDataFolder(), path);
        if (!file.exists()) {
            saveResource(path, false);
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        String name = command.getName().toLowerCase();
        if (name.equals("fxhomes")) {
            if (args.length != 1 || !args[0].equalsIgnoreCase("reload")) {
                sendMessage(sender, "command-usage", Map.of("%usage%", "/fxhomes reload"));
                return true;
            }
            if (!sender.hasPermission("fxhomes.reload")) {
                sendMessage(sender, "no-permission", Map.of());
                return true;
            }
            reloadConfig();
            sendMessage(sender, "home-reload", Map.of());
            return true;
        }

        if (!(sender instanceof Player player)) {
            sendMessage(sender, "console-only", Map.of());
            return true;
        }
        if (!player.hasPermission("fxhomes.use")) {
            sendMessage(player, "no-permission", Map.of());
            return true;
        }

        if (name.equals("home") && args.length == 1) {
            int number;
            try {
                number = Integer.parseInt(args[0]);
            } catch (NumberFormatException exception) {
                sendMessage(player, "invalid-home", Map.of());
                return true;
            }
            if (number < 1 || number > 21) {
                sendMessage(player, "invalid-home", Map.of());
                return true;
            }
            HomeManager.HomeLocation home = homeManager.getHome(player.getUniqueId(), number);
            if (home == null) {
                sendMessage(player, "no-home", Map.of());
                return true;
            }
            World world = Bukkit.getWorld(home.world());
            if (world == null) {
                sendMessage(player, "home-world-unavailable", Map.of());
                return true;
            }
            player.teleport(homeLocation(home, world));
            return true;
        }

        if (args.length != 0) {
            sendMessage(player, "command-usage", Map.of("%usage%", name.equals("home") ? "/home [number]" : "/" + name));
            return true;
        }
        homesGui.openDashboard(player, 1);
        return true;
    }

    private final class TeleportCountdown extends BukkitRunnable {
        private final Player player;
        private final HomeManager.HomeLocation home;
        private final Location startingLocation;
        private int remaining;

        private TeleportCountdown(Player player, HomeManager.HomeLocation home, Location startingLocation, int remaining) {
            this.player = player;
            this.home = home;
            this.startingLocation = startingLocation;
            this.remaining = remaining;
        }

        @Override
        public void run() {
            UUID playerId = player.getUniqueId();
            if (teleportCountdowns.get(playerId) != this) {
                cancel();
                return;
            }
            if (!player.isOnline() || movedFromStart()) {
                teleportCountdowns.remove(playerId, this);