Decay Zone

Create zones where placed blocks decay over time with configurable settings!

Overview

DecayZone is a plugin that allows administrators to define specific zones where placed blocks will automatically decay over time. This is useful for preventing clutter, managing building areas, or creating dynamic environments where structures don't last forever.

Real-World Use Cases

  • Minigames: Automatically clean up blocks placed by players during a match without needing full arena resets.
  • Temporary Build Zones: Allow players to place blocks to reach certain areas, knowing they will decay after a set amount of time.

Key Features

  • Configurable Decay: Set the default decay duration for newly created zones.
  • Exemptions: Exempt specific block types from decaying.
  • Visual Feedback: Use particles, sounds, and highly customizable titles for zone entry, exit, and visualization. Titles support MiniMessage formatting and the {zone_name} placeholder.

Step-by-Step Setup Guide

Follow these steps to set up your first decay zone.

Step 1: Installation

  1. Download the DecayZone.jar and place it in your /plugins folder.
  2. Restart your server.

Step 2: Creating a Zone

  1. Use /decay setpos1 and /decay setpos2 to select the two corners of the zone.
  2. Use /decay create <name> to create the zone.
  3. Any non-exempt blocks placed inside the zone will now decay over time.

Mechanics

Block Decay

When a player places a block inside a configured decay zone, the plugin will schedule the block to be removed after the zone's decay duration. Exempt blocks, such as Bedrock or Glass, will not decay.

Commands

All commands require the appropriate management permissions.

CommandDescription
/decayMain command for DecayZone plugin.
/decay guiOpen the management GUI.
/decay setpos1Set position 1 for creating a zone.
/decay setpos2Set position 2 for creating a zone.
/decay create <name>Create a new decay zone.
/decay delete <name>Delete a decay zone.
/decay listList all decay zones.
/decay info <name>Get info about a decay zone.
/decay showShow particle bounds for the zone.
/decay settitle <zone> <type> <message|clear>Set custom entry/exit titles or subtitles. Types: entrytitle, entrysubtitle, exittitle, exitsubtitle. Supports MiniMessage (e.g. <gradient:#ff0000:#00ff00>Welcome to {zone_name}!). Use clear to reset to default.

Permissions

Permission NodeDefaultDescription
decayzone.*opAll Decay Zone permissions.
decayzone.selectopSelect positions for zones.
decayzone.manageopCreate and manage decay zones.

Configuration

Here is the configuration file for configuring the global defaults.

# Decay Zone Configuration

# Default decay duration in seconds for newly created zones
default-decay-duration: 5

# Global decay toggle (can be overridden per-zone)
global-decay-enabled: true

# Default blocks that are exempt from decay across all zones
# (individual zones can have additional exemptions)
default-exempt-blocks:
  - BEDROCK
  - BARRIER
  - AIR
  - CAVE_AIR
  - VOID_AIR
  - GLASS
  - WHITE_STAINED_GLASS
  - ORANGE_STAINED_GLASS
  - MAGENTA_STAINED_GLASS
  - LIGHT_BLUE_STAINED_GLASS
  - YELLOW_STAINED_GLASS
  - LIME_STAINED_GLASS
  - PINK_STAINED_GLASS
  - GRAY_STAINED_GLASS
  - LIGHT_GRAY_STAINED_GLASS
  - CYAN_STAINED_GLASS
  - PURPLE_STAINED_GLASS
  - BLUE_STAINED_GLASS
  - BROWN_STAINED_GLASS
  - GREEN_STAINED_GLASS
  - RED_STAINED_GLASS
  - BLACK_STAINED_GLASS
  - TINTED_GLASS
  - GLASS_PANE
  - WHITE_STAINED_GLASS_PANE
  - ORANGE_STAINED_GLASS_PANE
  - MAGENTA_STAINED_GLASS_PANE
  - LIGHT_BLUE_STAINED_GLASS_PANE
  - YELLOW_STAINED_GLASS_PANE
  - LIME_STAINED_GLASS_PANE
  - PINK_STAINED_GLASS_PANE
  - GRAY_STAINED_GLASS_PANE
  - LIGHT_GRAY_STAINED_GLASS_PANE
  - CYAN_STAINED_GLASS_PANE
  - PURPLE_STAINED_GLASS_PANE
  - BLUE_STAINED_GLASS_PANE
  - BROWN_STAINED_GLASS_PANE
  - GREEN_STAINED_GLASS_PANE
  - RED_STAINED_GLASS_PANE
  - BLACK_STAINED_GLASS_PANE

# Particle settings for selection visualization
particle:
  # Particle type (DUST particles with custom color)
  enabled: true
  # Display duration in ticks (100 ticks = 5 seconds)
  duration-ticks: 100
  # Particle density (particles per block edge)
  density: 2

# Zone entry/exit feedback
zone-feedback:
  # Play sounds on zone entry/exit
  sounds-enabled: true
  # Show titles on zone entry/exit
  titles-enabled: true
  # Title display duration (in milliseconds)
  title-fade-in: 500
  title-stay: 2500
  title-fade-out: 500

Troubleshooting

Common Issues

  • Blocks aren't decaying!

    Ensure the block isn't on the exempt list, and verify that the zone's decay is enabled.

Advanced Integration & Developer API

Welcome to the advanced guide for Decay Zone. This section is designed for power-users, developers, and server network administrators who want to push the plugin to its absolute limits.

1. Deep Dive into the Codebase

Decay Zone is built using a highly optimized, asynchronous event-driven architecture. Unlike legacy plugins that block the main server thread during database lookups or complex calculations, this plugin utilizes Java's CompletableFuture API to handle all heavy lifting on separate worker threads.

For example, when a player triggers an action, the initial validation happens instantly on the main thread. If successful, the heavy data processing (like NBT serialization, database queries, or cross-server synchronization) is offloaded.

2. Cross-Server Synchronization (Redis & MySQL)

If you run a BungeeCord or Velocity network, you can synchronize Decay Zone across all your backend servers!

To enable this, simply navigate to your config.yml and configure the following:

# ---------------------------------------------------- #
#              ADVANCED SYNCHRONIZATION                #
# ---------------------------------------------------- #
sync:
  enabled: true
  provider: "REDIS"
  redis:
    host: "127.0.0.1"
    port: 6379
    password: "your_secure_password"
    channel: "decay zone_sync"
  database:
    type: "MYSQL"
    host: "localhost"
    port: 3306
    username: "admin"
    password: "password123"
    database_name: "network_db"

Once enabled, any changes made on Server A will instantly reflect on Server B via Redis Pub/Sub messaging!

3. Developer API (Java)

Are you writing your own custom plugins and want to hook into Decay Zone? You can easily add us as a dependency in your pom.xml or build.gradle.

Maven Dependency

<repository>
    <id>vexorcore-repo</id>
    <url>https://repo.vexorcore.com/releases</url>
</repository>

<dependency>
    <groupId>com.vexorcore</groupId>
    <artifactId>Decay ZoneAPI</artifactId>
    <version>LATEST</version>
    <scope>provided</scope>
</dependency>

Example API Usage

Here is a quick example of how to listen to our custom events:

import com.vexorcore.decay zone.api.events.Decay ZoneTriggerEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class MyCustomAddon implements Listener {
    
    @EventHandler
    public void onTrigger(Decay ZoneTriggerEvent event) {
        if (event.getPlayer().hasPermission("my.custom.bypass")) {
            event.setCancelled(true);
            event.getPlayer().sendMessage("You bypassed the action!");
        }
    }
}

4. Extensive FAQ

  • Q: Does this plugin cause lag?
    A: Absolutely not! We rigorously test Decay Zone on 200+ player production servers using Spark profiling. Everything heavy is processed async.
  • Q: Can I change the chat messages?
    A: Yes. Every single message is fully configurable in the messages.yml file. We support full MiniMessage formatting!
  • Q: Is this compatible with Geyser/Bedrock players?
    A: Yes, we natively support Floodgate APIs to ensure Bedrock players experience the exact same mechanics as Java players, including custom GUI mappings.