heatrion

Develop a Minecraft plugin for version 26.2 that spawns special magma blocks in the Nether, each with a unique ID. When broken, these blocks will expand the Nether border by a configurable amount and send a customizable message to global chat. Implement distinguishing particle effects for these blocks, and allow admins to teleport to their locations, with configurable spawn frequency for the blocks.

Kodari AI
KodariSep 28 at 9:34 pm 1
NetherExpander
NetherExpander is a Minecraft plugin that spawns special magma blocks throughout the Nether at a configurable frequency. Each block receives a unique ID and emits distinct particle effects for easy identification. When a player breaks one of these blocks, the Nether world border expands by a configurable amount and a customizable message is broadcast to global chat. Admins can teleport directly to any spawned block's location using its unique ID, and all settings including spawn rates, expansion amounts, and messages are fully configurable via a YAML file.
  1. Set up the Paper 26.2 plugin and configurable spawn/border settings.

  2. Add persistent unique block IDs, Nether spawning, and particle effects.

  3. Handle breaks and add admin list/teleport commands.

Created NetherCore for Paper 26.2. It periodically spawns uniquely identified magma blocks in the Nether, persists their locations across restarts, and marks them with flame and lava particles. Breaking one expands the Nether world border and broadcasts the configurable message.

Admins can use /nethercore list and /nethercore tp <id>; spawn interval, active-block limit, radius, expansion amount, and break message are configurable.

heatrion

Is the spawn radius the radius for magma spawning around the player, or around the spawn point in the Nether?

Kodari AI
KodariSep 28 at 9:47 pm 1

It’s centered on the Nether’s world spawn point, not around a player. spawn-radius: 300 means magma blocks are placed within 300 blocks of spawn on both the X and Z axes.

heatrion

Magma blocks only spawn on the Nether roof; make them spawn below the roof on a solid surface, and ensure they cannot spawn inside the player or on their structures.

Kodari AI
KodariSep 28 at 10:03 pm 1
  1. Select valid air spaces above solid ground below the Nether roof.

  2. Exclude locations near players and persist player-placed blocks to protect structures across restarts.

  3. Update the config with the structure-protection radius and save tracked locations safely.

Updated spawning to choose air spaces above solid ground between Y=5 and Y=120, below the vanilla Nether roof. It now avoids players within 2 blocks and locations within the configurable structure-protection-radius (default 8) of player-placed Nether blocks. Those placements are saved across restarts; structures built before this tracking was installed can’t be identified automatically.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 444
src/main/java/com/kodari/nethercore/NetherCorePlugin.java
package com.kodari.nethercore;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Map;
import java.util.UUID;

public final class NetherCorePlugin extends JavaPlugin implements CommandExecutor {
    private NetherCoreManager manager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        manager = new NetherCoreManager(this);
        manager.load();
        getServer().getPluginManager().registerEvents(manager, this);
        getCommand("nethercore").setExecutor(this);
        manager.start();
    }

    @Override
    public void onDisable() {
        if (manager != null) {
            manager.save();
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!sender.hasPermission("nethercore.admin")) {
            sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
            return true;
        }

        if (args.length == 1 && args[0].equalsIgnoreCase("list")) {
            Map<UUID, Location> blocks = manager.getLocations();
            if (blocks.isEmpty()) {
                sender.sendMessage(ChatColor.YELLOW + "There are no active Nether Cores.");
                return true;
            }
            sender.sendMessage(ChatColor.GOLD + "Active Nether Cores:");
            for (Map.Entry<UUID, Location> entry : blocks.entrySet()) {
                Location location = entry.getValue();
                String worldName = location.getWorld() == null ? "unknown" : location.getWorld().getName();
                sender.sendMessage(ChatColor.YELLOW + entry.getKey().toString() + ChatColor.GRAY + " — "
                        + worldName + " " + location.getBlockX() + ", " + location.getBlockY() + ", "
                        + location.getBlockZ());
            }
            return true;
        }

        if (args.length == 2 && args[0].equalsIgnoreCase("tp")) {
            UUID id;
            try {
                id = UUID.fromString(args[1]);
            } catch (IllegalArgumentException exception) {
                sender.sendMessage(ChatColor.RED + "That is not a valid Nether Core ID.");
                return true;
            }

            Location location = manager.getLocation(id);
            if (location == null || location.getWorld() == null) {
                sender.sendMessage(ChatColor.RED + "No active Nether Core has that ID.");
                return true;
            }
            if (!(sender instanceof Player player)) {
                sender.sendMessage(ChatColor.RED + "Only players can teleport to Nether Cores.");
                return true;
            }
            player.teleport(location.clone().add(0.5, 1.0, 0.5));
            sender.sendMessage(ChatColor.GREEN + "Teleported to Nether Core " + id + ".");
            return true;
        }

        sender.sendMessage(ChatColor.YELLOW + "Usage: /nethercore list | /nethercore tp <id>");
        return true;
    }
}