pavitraxd_
📎 1 file 3,956 chars
📄
pasted-code-1771932931121.txt
txt 276 lines
▶
You are a senior Java developer specializing in high-performance Spigot/Paper Minecraft plugins.

Create a production-ready Minecraft plugin named:

⚔️ CombatLogX Pro

A professional combat logging detection system with Discord Webhook integration for real-time moderation alerts.

Target platform:

Minecraft 1.20+

Spigot & Paper

Java 17

🎯 Core Purpose

Prevent players from escaping PvP by logging out during combat.

If a player logs out while tagged:

They are punished.

The event is logged.

A detailed embed is sent to Discord via webhook.

🧠 Functional Requirements
1️⃣ Combat Tag System

When:

Player damages another player
OR

Player shoots another player with projectile

Then:

Both players receive a combat tag.

Tag duration configurable (default 15 seconds).

Combat timer resets if damage occurs again.

While tagged:

Player cannot:

Use /spawn

Use /home

Use /warp

Use /tp

Use ender pearls (configurable)

Player cannot enter safe zones (WorldGuard hook optional)

Display:

ActionBar countdown

BossBar countdown (configurable)

PlaceholderAPI support:
%combatlog_time%
%combatlog_status%

2️⃣ Combat Logout Handling

If player disconnects while tagged:

Configurable punishments:

Instant death

Drop inventory

Keep inventory but lose money

Kill with lightning effect

Spawn NPC body (optional advanced feature)

Log details:

Player name

UUID

Killer name (if exists)

World

XYZ coordinates

Timestamp

Remaining tag time

Store in:

SQLite database

Optional MySQL support

3️⃣ Discord Webhook Integration

When combat log happens:
Send a rich embed to Discord.

Webhook config:

discord:
  enabled: true
  webhook-url: "PASTE_WEBHOOK_URL"
  embed-color: "#ff0000"
  show-avatar-head: true
  show-coordinates: true

Embed Format:

Title:
🚨 Combat Log Detected

Description:
Player: {player}
Killed By: {killer}
World: {world}
Location: X:{x} Y:{y} Z:{z}
Time: {timestamp}
Remaining Tag: {time_left}s

Thumbnail:
Use player head via:
https://mc-heads.net/avatar/{uuid}

Footer:
CombatLogX Pro | Server Protection

Must use proper JSON webhook POST request.
Use async task to prevent server lag.

4️⃣ Admin Commands

/combatlog reload
/combatlog check 
/combatlog top
/combatlog history 
/combatlog settime 

Permissions:
combatlog.admin
combatlog.bypass
combatlog.notify

5️⃣ INVENTORY GUI Panel (Optional Advanced)

Inventory INVENTORY GUI:

Total combat logs today

Top offenders

Toggle punishments

View last 10 logs

6️⃣ Config.yml Structure

Create full professional config with:

combat:
  tag-duration: 15
  blocked-commands:
    - spawn
    - home
    - warp
  block-enderpearl: true
  show-bossbar: true
  show-actionbar: true

punishment:
  mode: "INSTANT_KILL" # INSTANT_KILL, LIGHTNING, DROP_ITEMS, MONEY_FINE
  fine-amount: 500

database:
  type: "SQLITE" # MYSQL
  mysql:
    host: "localhost"
    port: 3306
    database: "combatlog"
    username: "root"
    password: "password"

discord:
  enabled: true
  webhook-url: ""
  embed-color: "#ff0000"
7️⃣ Technical Requirements

Use Listener classes:

EntityDamageByEntityEvent

PlayerQuitEvent

PlayerCommandPreprocessEvent

Use BukkitRunnable async tasks where needed.

Use proper dependency injection.

Use clean OOP structure:

CombatManager

TagManager

DiscordWebhookService

DatabaseManager

Optimize performance for 100+ players.

No memory leaks.

Proper null checks.

Use UUID instead of player name.

Follow Spigot best practices.

8️⃣ Extra Advanced Features

Optional but impressive:

NPC remains for X seconds after logout

Anti-alt abuse detection

Combat log counter auto-ban after X times

PlaceholderAPI expansion class

API for other plugins

📦 Deliverables

Generate:

Full source code

plugin.yml

config.yml

Clean package structure

Maven pom.xml

README.md with installation guide

Make sure:

Code compiles without errors.

Webhook uses HttpURLConnection.

No deprecated API usage.

Fully production ready.
pavitraxd_

start making

Kodari AI
KodariFeb 25 at 9:25 am 190 (v2)
SimpleChatPlugin
A lightweight Minecraft plugin that enhances in-game chat functionality. It provides features like chat formatting, color codes support, anti-spam filters, and basic moderation tools. Players can use color codes in chat if they have permission, and admins can mute players or clear chat. Integrates with permissions systems for role-based chat prefixes and suffixes.
Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code