elixr0297
📎 1 file 2,191 chars
📄
pasted-code-1777309829336.txt
txt 92 lines
â–¶
I want you to create a complete, production-ready Minecraft Java plugin.

Plugin Name: OriginsTest
Minecraft Version: 1.20+
Platform: Paper ONLY (use Adventure API for titles)

Plugin Concept:
When an operator runs:

/origins start

Every online player is randomly assigned one of 3 test origins:

- Strength (Yellow particles)
- Blaze (Orange particles)
- Defence (Blue particles)

This is only Phase 1 testing.

--------------------------------------------------

CORE REQUIREMENTS

1. Command:
- /origins start
- Permission: origins.admin
- Must prevent running again while animation is active.
- Broadcast: "The Origins have awakened..."

2. Origin Assignment:
- Random origin per online player.
- Store in HashMap.
- No data saving yet.

3. Particle Ring:
- Use Particle.REDSTONE with DustOptions.
- Colors:
    Strength = RGB(255,255,0)
    Blaze = RGB(255,140,0)
    Defence = RGB(0,100,255)
- Radius: 1.5 blocks.
- Smooth rotating circle.
- Runs for exactly 10 seconds.
- Use BukkitRunnable.
- Must cancel task properly after 10 seconds.
- Optimized for multiple players.

4. TITLE DISPLAY (IMPORTANT — MUST WORK)

- Use Paper Adventure API:
    player.showTitle(Title.title(Component, Component, Title.Times))
- DO NOT use deprecated sendTitle.
- Title must display AFTER particles begin.
- Title must say:

   Main Title: "You are..."
   Subtitle: "" (Large, bold, colored to match origin)

- Fade in: 20 ticks
- Stay: 120 ticks
- Fade out: 40 ticks

- Ensure:
   - Title definitely appears.
   - Not sent asynchronously.
   - Sent on main server thread.
   - Uses Component.text() from net.kyori.adventure.text.

5. Structure:
- Main class
- OriginManager
- OriginType enum
- OriginCommand
- AnimationManager

6. Technical:
- No deprecated API.
- Proper null checks.
- No memory leaks.
- Clean OOP.
- Must compile without errors.

7. Include:
- Full plugin.yml
- Full folder structure
- All imports
- Every file shown separately
- No shortened code

IMPORTANT:
This must be expandable later for adding abilities.
Make the architecture scalable for 8 origins.
Kodari AI
KodariApr 27 at 5:12 pm 7,393 (v2)

I’ll create a complete, production-ready Origins plugin with proper Paper Adventure API integration and particle animations.

OriginsTest
A Minecraft plugin that assigns random Origins to players with visual particle effects and title announcements. Features three test origins—Strength, Blaze, and Defence—each with unique colored particle rings and coordinated title displays. Built with scalable architecture to support expansion to 8+ origins with custom abilities. Uses Paper's Adventure API for modern text components and optimized particle rendering for multiplayer environments.

Summary

Created a complete Origins plugin with:

Architecture:

  • Clean separation: managers handle logic, commands handle input, enums define data

  • Scalable design ready for 8+ origins (just add enum values)

  • Proper cleanup and memory management

Key Features:

  • /origins start with origins.admin permission

  • Prevents duplicate animations

  • Random origin assignment stored in HashMap

  • 10-second particle rings using REDSTONE particles with color-specific DustOptions

  • Smooth rotating circle animation (radius 1.5 blocks, 30 particles)

  • Paper Adventure API titles with proper timing (fade: 1s, stay: 6s, fade: 2s)

  • Title displays 1 second after particles begin

  • Broadcast message on start

Technical Highlights:

  • Uses BukkitRunnable.runTaskTimer() for smooth per-tick animation

  • Per-player tick counting for synchronized effects

  • Proper task cancellation after 200 ticks

  • All operations on main thread (no async issues)

  • No deprecated methods

  • Tab completion included

Ready to compile and test on Paper 1.20+. The plugin will assign Strength (yellow), Blaze (orange), or Defence (blue) origins with matching particle colors and bold colored titles.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
8 423
src/main/java/com/originstest/OriginsTest.java
package com.originstest;

import com.originstest.command.OriginCommand;
import com.originstest.manager.AnimationManager;
import com.originstest.manager.OriginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class OriginsTest extends JavaPlugin {
    private OriginManager originManager;
    private AnimationManager animationManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.originManager = new OriginManager();
        this.animationManager = new AnimationManager(this, originManager);
        
        OriginCommand originCommand = new OriginCommand(this);
        getCommand("origins").setExecutor(originCommand);
        getCommand("origins").setTabCompleter(originCommand);
        
        getLogger().info("OriginsTest v" + getDescription().getVersion() + " has been enabled!");
        getLogger().info("Phase 1: Random origin assignment with particle effects");
    }
    
    @Override
    public void onDisable() {
        if (animationManager != null && animationManager.isAnimationRunning()) {
            animationManager.stopAnimation();
        }
        
        if (originManager != null) {
            originManager.clearAllOrigins();
        }
        
        getLogger().info("OriginsTest has been disabled!");
    }
    
    public OriginManager getOriginManager() {
        return originManager;
    }
    
    public AnimationManager getAnimationManager() {
        return animationManager;
    }
}