Y
๐
1 file
5,158 chars
๐
pasted-code-1776525543699.txt
txt
324 lines
โถ
pasted-code-1776525543699.txt
txt
324 lines
Create a fully functional, production-ready Minecraft plugin using Java and the Spigot/Paper API (latest version, e.g., 1.20+).
Plugin Name: GenomeSMP
The plugin must be clean, optimized, multiplayer-safe, and structured using proper OOP practices. Avoid incomplete code. Provide a full working implementation.
---
# ๐ฅ CORE CONCEPT
This is a DNA-based SMP system where:
* Players obtain DNA powers
* Equip DNA
* Use abilities via a key
* Engage in PvP with DNA mechanics
The system must be SIMPLE to use, but scalable and clean internally.
---
# ๐ฌ 1. SMP START SYSTEM
Command: /smpstart
Requirements:
* Applies levitation effect to ALL online players for 3โ4 seconds
* Do NOT add heavy particles or laggy visuals
* Use Bukkit scheduler for timing (no blocking thread)
* After levitation ends:
* Give each player 1 random BASIC DNA
Edge cases:
* Handle players joining during the event
* Prevent re-running while active (cooldown or boolean flag)
---
# ๐งฌ 2. DNA SYSTEM
Each player has:
* activeDNA (String)
* secondaryDNA (String)
* exclusiveDNA (String, optional)
Rules:
* Max 2 DNA equipped total
* Only 1 exclusive DNA allowed
DNA must be stored using:
* UUID-based storage
* YAML file persistence (players.yml)
Create a PlayerDNA class to manage this.
---
# ๐งช 3. DNA ITEM SYSTEM
Use PersistentDataContainer (NOT deprecated NBT APIs).
Keys:
* dna_type (String)
* dna_level (basic/exclusive)
Items:
Basic DNA:
* Material: GLASS_BOTTLE
* Name: " DNA Vial"
Exclusive DNA:
* Material: NETHER_STAR
* Name: " Genome Core"
Important:
* Prevent stacking if necessary
* Always validate metadata before reading tags
* Add lore describing ability
---
# ๐ฎ 4. ADMIN COMMAND
Command:
/givedna
Examples:
/givedna Steve creeper
/givedna Alex dragon
Requirements:
* Only OP or permission: genomesmp.admin
* Validate DNA type
* Give correct item with proper metadata
---
# ๐ 5. DNA EQUIP SYSTEM
Mechanics:
* Right-click DNA item โ equips DNA
* Cancel default interaction if needed
* Do NOT require holding item for ability usage
Logic:
* If player has <2 DNA โ add
* If full โ replace secondary DNA
Store equipped DNA in memory + file
---
# โ๏ธ 6. ABILITY SYSTEM (KEY BASED)
IMPORTANT: Use ONLY ONE KEY
Trigger:
* PlayerSwapHandItemsEvent (default key: F)
When player presses F:
* Cancel item swap
* Detect player DNA
* Execute ability
DO NOT rely on held item.
---
# ๐งฌ 7. ABILITY IMPLEMENTATION
Use AbilityManager class.
Switch based on DNA type:
Creeper:
* createExplosion(location, power, false, false)
Enderman:
* teleport forward safely (check solid block)
Blaze:
* launch Fireball projectile
Spider:
* apply jump boost + temporary climb (potion effects)
---
# ๐ 8. EXCLUSIVE DNA
Wither:
* spawn 3 wither skulls in direction player is facing
* apply wither effect on hit
Dragon:
* apply velocity forward (dash)
* damage nearby entities
* OPTIONAL: area effect cloud (dragon breath)
Warden:
* simulate sonic boom (ray trace or line damage)
* damage entities in line
---
# โฑ๏ธ 9. COOLDOWN SYSTEM
Implement per-player cooldowns:
Structure:
Map>
Requirements:
* Check before ability use
* Store timestamp
* Compare System.currentTimeMillis()
Show feedback:
* Action bar OR chat message
---
# ๐ 10. PVP SYSTEM
On PlayerDeathEvent:
* Remove 1 DNA from victim
* Randomly select from equipped DNA
On PlayerKill:
* Chance (configurable) to give stolen DNA item
Prevent duplication:
* Carefully remove + give items
---
# ๐พ 11. DATA STORAGE
Use YAML:
players.yml:
* uuid:
activeDNA: creeper
secondaryDNA: blaze
exclusiveDNA: dragon
Save:
* On player quit
* On server shutdown
Load:
* On player join
---
# ๐งฑ 12. PROJECT STRUCTURE
Use packages:
* main
* commands
* dna
* abilities
* listeners
* utils
Classes:
* Main
* DNAItemManager
* DNAEquipManager
* AbilityManager
* CooldownManager
* PlayerDataManager
* CommandGiveDNA
* SMPStartCommand
* SwapListener
* DeathListener
---
# โก 13. PERFORMANCE RULES
* Do NOT run heavy loops on main thread
* Use scheduler for delays
* Limit particles
* Avoid spawning too many entities
* Validate all null checks
---
# ๐งพ 14. CONFIG FILE
config.yml:
* cooldowns
* damage values
* steal chance
* explosion power
---
# ๐ฆ 15. OUTPUT REQUIREMENTS
Provide FULL implementation:
1. All Java classes (complete, no placeholders)
2. plugin.yml
3. config.yml
4. Instructions to compile (Maven or Gradle)
5. How to install and test on server
---
# โ IMPORTANT
* Code must compile without errors
* No pseudo-code
* No missing imports
* No deprecated API usage
* Must work in real SMP server
---
# ๐ฏ FINAL GOAL
A clean, stable, multiplayer-ready DNA SMP plugin with:
* Key-based abilities (F key)
* Simple UI
* No bugs
* Smooth gameplay
Y
start
KodariApr 19 at 4:56 am 1,286 (v2)
Iโm ready to create a new Minecraft plugin project for you!
To get started, I need to know what kind of plugin youโd like me to build. Here are some examples:
Common Plugin Types:
Economy/Shop systems
Minigame/PvP systems
RPG/Leveling systems
Admin/Moderation tools
Custom mechanics (enchants, items, blocks)
Server utilities (teleportation, homes, warps)
Social features (chat, parties, guilds)
Please tell me:
What type of plugin do you want?
What are the main features it should have?
Any specific requirements (commands, GUIs, database, etc.)?
Once you describe what you need, Iโll set up the complete project structure with all necessary files!
Y
regenrate
KodariApr 19 at 4:57 am 100 (v2)
The generation was stopped before any content could be produced.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code