amanbro0581

Create a complete Minecraft Paper 1.21.4 plugin called “Element SMP”.

Main idea:

Every player receives one random element when they join for the first time. The possible elements are Fire, Water, Earth, Air, Shadow, and Light. Each element gives special passive abilities, active powers, and its own unique item token using existing Minecraft items.

The plugin must include:

  • Random element assignment on first join
  • Element stealing system
  • Element energy system
  • Hybrid elements
  • First join guide book
  • Cooldowns
  • Configurable rarities
  • Custom item names and lore
  • Commands and permissions
  • Full config.yml support
  • Data saved in YAML or SQLite
  • Resource-pack-ready support if needed later

━━━━━━━━━━━━━━━━━━━━━━ ELEMENT SYSTEM ━━━━━━━━━━━━━━━━━━━━━━

Each player starts with:

  • 1 random base element
  • 100 Element Energy
  • 1 Element Token item
  • 0 deaths

A player may keep their element for only 2 deaths.

After their 2nd death:

  • They lose their element token
  • They lose all abilities
  • They cannot receive another random element
  • To get an element again, they must kill another player and steal their element

When a player kills another player:

  • Killer steals the victim’s element
  • Victim loses that element
  • Victim receives no new element if they already died 2 times
  • If victim has died less than 2 times, give them a new random element

Death counter:

  • 1st death = New random element
  • 2nd death = New random element
  • 3rd death and higher = No element until they kill someone

━━━━━━━━━━━━━━━━━━━━━━ BASE ELEMENTS ━━━━━━━━━━━━━━━━━━━━━━

🔥 FIRE Item Token: BLAZE_POWDER Display Name: §c§lFire Element Passives:

  • Immune to fire and lava
  • +10% damage

Abilities:

  • Right-click token = Fireball
  • Sneak + Right-click = Ring of Fire
  • Shift + Left-click = Flame Dash

🌊 WATER Item Token: WATER_BUCKET Display Name: §b§lWater Element Passives:

  • Breathe underwater
  • Swim faster

Abilities:

  • Right-click token = Water Wave
  • Sneak + Right-click = Heal in water
  • Shift + Left-click = Ice Trap

🌍 EARTH Item Token: GRASS_BLOCK Display Name: §2§lEarth Element Passives:

  • +4 hearts
  • Knockback resistance

Abilities:

  • Right-click token = Stone Wall
  • Sneak + Right-click = Ground Slam
  • Shift + Left-click = Earth Armor

🌪 AIR Item Token: WIND_CHARGE Display Name: §f§lAir Element Passives:

  • Speed I
  • No fall damage

Abilities:

  • Right-click token = Dash
  • Sneak + Right-click = Launch Up
  • Shift + Left-click = Tornado Push

🌑 SHADOW Item Token: ENDER_EYE Display Name: §5§lShadow Element Passives:

  • Night Vision
  • Less damage in darkness

Abilities:

  • Right-click token = Invisibility
  • Sneak + Right-click = Teleport Behind Player
  • Shift + Left-click = Shadow Clone

☀ LIGHT Item Token: GLOWSTONE_DUST Display Name: §e§lLight Element Passives:

  • Regeneration during daytime
  • Bonus damage against Shadow

Abilities:

  • Right-click token = Heal
  • Sneak + Right-click = Flashbang
  • Shift + Left-click = Beam of Light

━━━━━━━━━━━━━━━━━━━━━━ HYBRID ELEMENTS ━━━━━━━━━━━━━━━━━━━━━━

When a player steals enough energy from another element, they unlock a hybrid.

Every kill steals 25 energy.

When a player collects 100 energy from another element, they unlock the hybrid.

Hybrids:

  • Fire + Water = Steam
  • Fire + Earth = Magma
  • Fire + Air = Storm
  • Fire + Shadow = Hellfire
  • Fire + Light = Solar
  • Water + Earth = Nature
  • Water + Air = Ice
  • Water + Shadow = Abyss
  • Water + Light = Holy Water
  • Earth + Air = Sand
  • Earth + Shadow = Cursed Earth
  • Earth + Light = Crystal
  • Air + Shadow = Void
  • Air + Light = Sky
  • Shadow + Light = Eclipse

Hybrid item icons:

  • Steam = GLASS_BOTTLE
  • Magma = MAGMA_BLOCK
  • Storm = LIGHTNING_ROD
  • Hellfire = SOUL_FIRE_CHARGE
  • Solar = SUNFLOWER
  • Nature = VINE
  • Ice = PACKED_ICE
  • Abyss = INK_SAC
  • Holy Water = POTION
  • Sand = SAND
  • Cursed Earth = SOUL_SOIL
  • Crystal = AMETHYST_SHARD
  • Void = ENDER_PEARL
  • Sky = ELYTRA
  • Eclipse = NETHER_STAR

Each hybrid should have:

  • 2 passive abilities
  • 3 active abilities
  • Stronger effects than normal elements
  • Longer cooldowns

━━━━━━━━━━━━━━━━━━━━━━ FIRST JOIN BOOK ━━━━━━━━━━━━━━━━━━━━━━

When a player joins for the first time, give them a written book.

Book Title:

Element SMP Guide

Author:

Prabhat Pie

Page 1: §4§l ⚡ CREATED BY PRABHAT PIE • [OWNER] ⚡

Centered and dark red colored.

Page 2:

Welcome to Element SMP!

Explain:

  • Everyone gets one random element
  • Elements give powers and abilities
  • You can steal elements from other players

Page 3:

Explain the death system:

  • You only receive new elements for your first 2 deaths
  • After that you must kill players to get one again

Page 4:

Explain all base elements and their item icons:

  • Fire = Blaze Powder
  • Water = Water Bucket
  • Earth = Grass Block
  • Air = Wind Charge
  • Shadow = Ender Eye
  • Light = Glowstone Dust

Page 5:

Explain hybrid elements and energy stealing.

Page 6: “Master your element and become the strongest player on the server.”

━━━━━━━━━━━━━━━━━━━━━━ ITEM FORMAT ━━━━━━━━━━━━━━━━━━━━━━

Every element item must:

  • Glow using hidden enchantment
  • Have custom lore
  • Show rarity
  • Be unbreakable
  • Not stack

Example: §c§lFire Element §7Element: Fire §7Right-click to unleash fire powers. §8Rarity: Base Element

━━━━━━━━━━━━━━━━━━━━━━ ADMIN COMMANDS ONLY EXIST ━━━━━━━━━━━━━━━━━━━━━━

/element give <player> <element> Give an element manually

/element remove <player> Remove a player’s element

/element reload Reload config

/element energy <player> View energy levels

━━━━━━━━━━━━━━━━━━━━━━ PERMISSIONS ━━━━━━━━━━━━━━━━━━━━━━ element.admin

━━━━━━━━━━━━━━━━━━━━━━ CONFIG OPTIONS ━━━━━━━━━━━━━━━━━━━━━━

Configurable:

  • Cooldowns
  • Damage values
  • Energy required for hybrids
  • Death limit before losing powers
  • Messages
  • Token item materials
  • Whether abilities work in PvP-safe zones
  • Enable or disable specific elements

Generate:

  • Full Java classes
  • plugin.yml
  • config.yml
  • messages.yml
  • Element manager
  • Ability manager
  • Book manager
  • Death manager
  • INVENTORY GUI for selecting elements
  • Full Maven project structure
  • Clean, optimized, production-ready code.Add these extra mechanics to the plugin:

━━━━━━━━━━━━━━━━━━━━━━ RESPAWN ELEMENT SYSTEM ━━━━━━━━━━━━━━━━━━━━━━

When a player dies:

  • They instantly lose their current element item
  • They do NOT receive a new element immediately on death

When the player respawns:

  • If they have died less than 2 times, they receive a new random element on respawn
  • If they have already died 2 times or more, they do not receive any new element
  • They must kill another player to steal an element again

Death logic:

  • 1st death → New random element on respawn
  • 2nd death → New random element on respawn
  • 3rd death+ → No element on respawn

━━━━━━━━━━━━━━━━━━━━━━ BOOK SETTINGS ━━━━━━━━━━━━━━━━━━━━━━

Book Title:

Element SMP Guide

Author:

PrabhatPie

━━━━━━━━━━━━━━━━━━━━━━ TOKEN PROTECTION SYSTEM ━━━━━━━━━━━━━━━━━━━━━━

Element items/tokens cannot be:

  • Dropped
  • Put inside any inventory or storage
  • Moved into any chest INVENTORY GUI
  • Stored in shulker boxes
  • Stored in bundles
  • Stored in backpacks from other plugins

Blocked storages must include:

  • Chest
  • Trapped Chest
  • Barrel
  • Ender Chest
  • Shulker Box
  • Bundle
  • Hopper
  • Dropper
  • Dispenser
  • Furnace
  • Blast Furnace
  • Smoker
  • Crafter
  • Brewing Stand
  • Item Frame
  • Armor Stand
  • Minecart Chest
  • Minecart Hopper
  • Decorated Pot
  • Any custom storage from plugins
  • Any “Copper Chest” type inventory if another plugin adds it

Required behavior:

  • Cancel InventoryClickEvent
  • Cancel InventoryDragEvent
  • Cancel PlayerDropItemEvent
  • Cancel shift-clicking
  • Cancel number-key moving
  • Cancel dragging to offhand if needed
  • Show message:

§cYou cannot store or drop your Element Token!

Also:

  • Token stays in the player inventory permanently while they have that element
  • If removed from inventory by any bug or plugin, automatically give it back after 1 second
  • If player dies and still keeps their element, re-give the token on respawn
Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code