mateuszglowacki2013-lang

Minecraft Player-Tracked Sky Airdrop System Spigot / Paper – Java Plugin Specification 0️⃣ ABSOLUTE RULES (READ FIRST)

This is NOT a suggestion – this is a strict specification

Do NOT simplify

Do NOT assume

Do NOT skip systems

If something is unclear, follow the MOST SAFE AND LOGICAL interpretation

Every mechanic must be deterministic, repeatable, and multiplayer-safe

1️⃣ HIGH-LEVEL CONCEPT (EXPLAINED CLEARLY)

This plugin creates a dynamic airdrop system similar to survival/PvP games.

A specific player is chosen as a reference point

The system periodically spawns loot drops near that player

Drops:

Fall from the sky

Are clearly visible

Are announced globally

Contain random but balanced loot

The system must feel:

Fair

Predictable

Exciting

Impossible to exploit

2️⃣ PLAYER TARGETING SYSTEM (CRITICAL) 2.1 Target Player Definition

The plugin maintains exactly ONE target player

This player is identified by:

UUID (not name internally)

The target player:

Must be online for drops to occur

Is the center reference for all drop calculations

2.2 Command to Set Target /dropyplayer <nickname>

Purpose:

Assigns the target player

Behavior:

If player exists and is online → assign

If player is offline → refuse or pause drops

Side effects:

Starts or resumes the drop timer

Permission-protected

3️⃣ DROP TIMING SYSTEM (DETAILED) 3.1 Automatic Drops

Drops occur every 7 minutes (420 seconds)

Timer characteristics:

Server-side

Tick-based or scheduler-based

Accurate even under lag

Timer starts when:

A target player is set

Timer pauses when:

Target player logs out

3.2 Manual Drop /calldrop

Instantly triggers a drop

Uses the exact same logic as automatic drops

Does NOT:

Reset timer

Change target player

Admin-only

4️⃣ DROP LOCATION SYSTEM (ULTRA IMPORTANT) 4.1 Conceptual Explanation (FOR AI UNDERSTANDING)

The player is the center

The drop must land somewhere around them

The drop must NEVER:

Use fixed coordinates

Ignore player position

Spawn globally/randomly on the map

4.2 Exact Technical Algorithm

When a drop is triggered:

Retrieve the current, real-time location of the target player:

World

X

Y

Z

Treat:

playerX

playerZ as the absolute center point

Generate random horizontal offsets:

offsetX = random(-300, +300)

offsetZ = random(-300, +300)

Calculate final coordinates:

dropX = playerX + offsetX

dropZ = playerZ + offsetZ

Constraints:

Horizontal distance from player MUST be ≤ 300 blocks

World MUST be identical to player’s world

Calculation MUST happen at trigger time (not cached)

Recalculation rules:

Each drop recalculates independently

Player movement affects future drops, not current one

4.3 Optional Improvement (Allowed)

Use polar coordinates:

Random angle (0–360°)

Random distance (0–300)

This ensures a true circular radius, not a square

5️⃣ SKY SPAWN + FALLING LOGIC (ANTI-BUG SYSTEM) 5.1 Spawn Height

Determine:

Highest solid block at (dropX, dropZ)

Spawn chest at:

highestY + 30

5.2 Falling Simulation

The chest must:

Fall downward gradually

Check below every tick or step

Collision rules:

If block below is solid → STOP

Solid blocks include:

Full blocks

Non-solid blocks (ignored):

Air

Leaves

Water

Lava

Grass

Snow layers

5.3 Absolute Anti-Glitch Rules

The chest must NEVER:

Spawn inside terrain

Clip into walls

Stop inside slabs or stairs

Fall through blocks

End up underground

If unsafe:

Adjust upward

Recalculate landing Y

6️⃣ VISUAL MARKER SYSTEM (PARTICLE BEAM) 6.1 Purpose

Make the drop visible from far away

Guide players to the location

6.2 Implementation

When chest lands:

Spawn a vertical red particle beam

Particle:

Redstone particle

Color: pure red

Behavior:

Starts at chest

Extends upward continuously

Lifetime:

Until chest is opened

OR timeout (configurable)

7️⃣ CHAT BROADCAST SYSTEM 7.1 Message Content

Broadcast to ALL online players:

📦 AIRDROP HAS LANDED!

X: <x> | Y: <y> | Z: <z>

7.2 Rules

Exact block coordinates

Same world as player

Colored formatting allowed

Sent only once per drop

8️⃣ DROP CONTAINER DETAILS

Type: Vanilla chest

Behavior:

Lootable by anyone

No protection

Despawn conditions:

Chest emptied

OR time limit exceeded

9️⃣ LOOT SYSTEM (VERY DETAILED) 9.1 Loot Philosophy

Random but fair

Strong but not broken

PvP-appropriate

Replayable

9.2 Loot Categories ARMOR

Diamond

Iron

Gold

Random armor pieces

WEAPONS

Iron sword

Diamond sword

Iron axe

Diamond axe

TOOLS

Pickaxe

Axe

Shovel

FOOD

Golden Apple ×1

Enchanted Golden Apple ×1 (very rare)

Cooked meat ×20

10️⃣ ENCHANTMENT SYSTEM (STRICT)

ONLY vanilla enchantments

NO custom enchants

Enchant level:

Minimum: 1

Maximum: 5

Enchant compatibility rules apply

Each item:

May have enchant

Or may be unenchanted

11️⃣ RANDOMIZATION LOGIC

Each chest:

Random number of items

Each slot:

Independently rolled

Enchant chance:

Configurable

Rare items:

Lower probability

12️⃣ CONFIGURATION FILE

Must support:

Drop interval

Drop radius

Loot chances

Enchant chance

Max enchant level

Particle duration

Chest despawn time

13️⃣ EDGE CASE PROTECTION

Handle:

Player logout mid-drop

Chunk unload

Multiple drops

Lag

Duplication exploits

World unloads

14️⃣ CODE STRUCTURE REQUIREMENTS

Java

Spigot/Paper

Separate managers:

DropManager

LocationCalculator

LootGenerator

ParticleManager

CommandManager

Clean, commented, readable

Kodari AI
KodariJan 14 at 6:24 pm 10,826 (v2)

I’ll create a comprehensive Sky Airdrop System plugin with all specified mechanics.

SkyAirdrop
A dynamic airdrop system that spawns loot drops from the sky near a tracked player. Features automatic 7-minute interval drops, manual triggers, circular 300-block radius spawning, falling chest physics, red particle beam markers, global broadcasts, and balanced randomized loot with configurable enchantments. Includes player targeting, anti-glitch spawn logic, and multiplayer-safe mechanics.

Creating the complete plugin structure:

Complete SkyAirdrop system created with:

Core Features:

  • Player targeting via /dropyplayer <player> (UUID-based)

  • Automatic drops every 7 minutes (configurable)

  • Manual trigger via /calldrop

  • Circular 300-block radius calculation using polar coordinates

  • Sky spawn with realistic falling physics

  • Red particle beam markers

  • Global coordinate broadcasts

  • Balanced loot with enchantments

  • Auto-despawn system

Managers:

  • DropManager: Timer, spawn logic, chest lifecycle

  • LocationCalculator: Circular radius calculations

  • LootGenerator: Randomized loot with XSeries enchantments

  • ParticleManager: Red particle beams

  • CommandManager: Handled via command executors

Safety Features:

  • Anti-glitch spawn detection

  • Chunk-load safe

  • Multiplayer-safe UUID tracking

  • Empty chest auto-removal

  • Configurable despawn timers

All systems follow XSeries patterns for cross-version compatibility (1.8-1.21+).

mateuszglowacki2013-lang

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/skyairdrop/manager/LootGenerator.java at line 120: cannot find symbol
            xEnchant.getEnchant().ifPresent(enchant -> {
                                 ^
  symbol: method ifPresent((enchant)-[...]l); })
  location: class Enchantment

ERROR in src/main/java/com/skyairdrop/manager/ParticleManager.java at line 54: cannot find symbol
        XParticle.of(Particle.REDSTONE).ifPresent(xParticle -> {
                             ^
  symbol: variable REDSTONE
  location: class Particle

ERROR in src/main/java/com/skyairdrop/manager/ParticleManager.java at line 60: cannot find symbol
                    Particle.REDSTONE,
                            ^
  symbol: variable REDSTONE
  location: class Particle


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - ifPresent((enchant)-[...]l); })
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/com/skyairdrop/manager/LootGenerator.java
  - src/main/java/com/skyairdrop/manager/ParticleManager.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJan 14 at 6:28 pm 7,463 (v2)

I need to read the files with compilation errors to fix them correctly.

Analysis

The errors are:

  1. Line 120 in LootGenerator: xEnchant.getEnchant() returns Enchantment, not Optional<Enchantment> - cannot call .ifPresent() on it

  2. Lines 54 & 60 in ParticleManager: Using Particle.REDSTONE directly instead of XSeries string-based matching

Fixes

  • LootGenerator: getEnchant() already returns the Enchantment, no need for ifPresent

  • ParticleManager: Use XParticle.of("REDSTONE") instead of Particle.REDSTONE

Fixed both compilation errors:

  • LootGenerator: Removed incorrect .ifPresent() call on Enchantment (line 120)

  • ParticleManager: Changed Particle.REDSTONE to XParticle.of("REDSTONE") with proper .get() call

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
12 753
src/main/java/com/skyairdrop/SkyAirdrop.java
package com.skyairdrop;

import com.skyairdrop.command.CallDropCommand;
import com.skyairdrop.command.DropYPlayerCommand;
import com.skyairdrop.listener.ChestListener;
import com.skyairdrop.manager.DropManager;
import com.skyairdrop.manager.LocationCalculator;
import com.skyairdrop.manager.LootGenerator;
import com.skyairdrop.manager.ParticleManager;
import lombok.Getter;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class SkyAirdrop extends JavaPlugin {
    
    private DropManager dropManager;
    private LocationCalculator locationCalculator;
    private LootGenerator lootGenerator;
    private ParticleManager particleManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        FileConfiguration config = getConfig();
        
        this.locationCalculator = new LocationCalculator(config);
        this.lootGenerator = new LootGenerator(config);
        this.particleManager = new ParticleManager(this, config);
        this.dropManager = new DropManager(this, config);
        
        getCommand("dropyplayer").setExecutor(new DropYPlayerCommand(this));
        getCommand("calldrop").setExecutor(new CallDropCommand(this));
        
        getServer().getPluginManager().registerEvents(new ChestListener(this), this);
        
        getLogger().info("SkyAirdrop has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (dropManager != null) {
            dropManager.shutdown();
        }
        if (particleManager != null) {
            particleManager.shutdown();
        }
        getLogger().info("SkyAirdrop has been disabled!");
    }
    
    public String colorize(String message) {
        return message.replace("&", "§");
    }
}