Sudagani John goud
πŸ“Ž 1 file 8,158 chars
πŸ“„
pasted-code-1790347334695.txt
txt 283 lines
β–Ά
Create a complete Minecraft Paper plugin called "MaskPowers".

Target:
- Paper 26.2-121
- Java 21
- Gradle
- Provide complete source code, plugin.yml, config.yml, Gradle files, and folder structure.
- The plugin must be production-ready and compile without errors.

CONCEPT:
The plugin adds powerful magical/superhero-style MASKS.
Each mask gives the player a unique special power. Masks should feel rare, powerful, and exciting, but they must have cooldowns and limits so they don't completely destroy survival gameplay.

MASK SYSTEM:
Players obtain masks through commands initially:
 /mask give  
 /mask list
 /mask info 
 /mask reload

Masks should be represented as special Minecraft items with:
- Custom name
- Custom lore
- Custom model data support
- Enchant/glow effect
- Unique identifier using PersistentDataContainer
- The mask should not lose its identity when renamed or moved.
- Prevent normal crafting of masks unless configured.
- Configurable rarity for every mask.

When a player equips a mask:
- Detect the mask being worn in the helmet slot.
- Activate that mask's powers.
- Display a small action-bar message showing the mask and cooldown.
- If the mask is removed, its powers stop working.
- Only one mask can be active at a time.

IMPORTANT:
Do NOT make every power permanent.
Use energy/mana and cooldown systems where appropriate.
Add configurable damage, radius, duration, cooldown and energy costs.

MASKS:

1. SKY MASK
Power: "Sky Float"
- Player can temporarily float/levitate in the air.
- Activate with a configurable key/action such as RIGHT CLICK.
- Give controlled Levitation or a custom flight-like movement.
- Player should not take fall damage after using the ability.
- Add particles around the player.
- Add configurable duration and cooldown.

2. MAGNETIC MASK
Power: "Magnetic Force"
- Creates a magnetic field around the player.
- Pull nearby dropped items toward the player.
- Can pull nearby mobs slightly toward the player.
- Can attract metallic Minecraft items such as iron, gold, copper, tools and armor.
- Optional ability: knock nearby enemies backward using a magnetic pulse.
- Add particles and sound effects.
- Configurable radius, pull strength, cooldown and duration.

3. ASTEROID MASK
Power: "Call Asteroid"
- When activated, summon a giant flaming asteroid from the sky toward a target location.
- The asteroid should visually travel through the sky.
- Create smoke, fire, particles and sound effects.
- On impact, create a powerful explosion-like effect.
- IMPORTANT: Make the destruction configurable.
- Default should NOT destroy blocks to prevent server griefing.
- Can damage nearby mobs/players.
- Add warning particles/circles before impact.
- Configurable impact radius, damage, cooldown and energy cost.

4. GRAVITY MASK
Power: "Gravity Control"
- Temporarily increase gravity around a target area.
- Nearby enemies receive Slowness and/or strong downward velocity.
- Optionally pull entities toward the center.
- Create a visible gravity field using particles.
- Configurable radius and duration.

5. FIRE MASK
Power: "Inferno"
- Create a fire explosion around the player or target.
- Set nearby hostile mobs on fire.
- Optional fireball projectile.
- Do not permanently grief the world unless enabled in config.
- Add fire particles and sounds.

6. ICE MASK
Power: "Frozen Domain"
- Create an icy area around the player.
- Slow nearby enemies.
- Freeze/water effects and snow/ice particles.
- Optional ability to freeze mobs temporarily.
- Configurable radius and duration.

7. THUNDER MASK
Power: "Thunder Strike"
- Target a location and call lightning from the sky.
- Lightning should damage nearby enemies.
- Add thunder sound and particles.
- Configurable number of strikes, radius, damage and cooldown.
- Avoid excessive lightning spam.

8. TIME MASK
Power: "Time Freeze"
- Temporarily slow nearby mobs and players.
- The user remains mostly unaffected.
- Create clock/time particles.
- Configurable radius and duration.
- Strong cooldown because this is a powerful ability.

9. VOID MASK
Power: "Void Rift"
- Open a temporary dark portal/rift at the target location.
- Pull nearby mobs toward the center.
- Damage entities caught inside.
- Add dark particles and sounds.
- Do not permanently delete blocks.
- Configurable radius, duration and damage.

10. ENERGY MASK
Power: "Energy Blast"
- Fire a powerful energy projectile.
- On impact, create an energy explosion.
- Damage entities in a radius.
- No block destruction by default.
- Add custom particles and sound effects.

ABILITY SYSTEM:
Every mask must have:
- Primary ability
- Optional passive ability
- Cooldown
- Energy cost
- Visual effects
- Sound effects
- Action-bar feedback
- Configurable values

Example:
[MASK] ASTEROID
Ability: Call Asteroid
Energy: 80
Cooldown: 60 seconds

ENERGY SYSTEM:
- Each player has mask energy.
- Maximum energy configurable.
- Energy regenerates automatically.
- Abilities consume energy.
- Show energy in action bar.
- Admin commands:
  /mask energy  
  /mask reset 

COOLDOWNS:
- Every ability has its own cooldown.
- Prevent ability spam.
- Show remaining cooldown in action bar.
- Configurable cooldowns in config.yml.

VISUAL EFFECTS:
Make abilities feel cinematic:
- Particles
- Sounds
- Screen/title messages when appropriate
- Projectile trails
- Impact effects
- Warning circles
- Lightning
- Smoke
- Fire
- Dust
- End rod particles
- Portal particles

Do not use resource-pack-dependent features for the basic version.
The plugin must work on a normal Paper server.

BALANCE:
The masks are supposed to be extremely powerful and rare, but survival gameplay must remain playable.
Add configuration options for:
- Damage
- Radius
- Duration
- Cooldown
- Energy cost
- Block damage
- Mob damage
- Player damage
- PvP enabled/disabled
- World whitelist/blacklist

SAFETY:
- Never permanently destroy the world by default.
- Respect WorldGuard regions if WorldGuard is installed.
- Add a config option to disable mask abilities in specific worlds.
- Prevent abilities from working while the player is dead.
- Prevent duplicate active masks.
- Prevent ability use if the player is in spectator mode.

COMMANDS:
 /mask give  
 /mask remove 
 /mask list
 /mask info 
 /mask energy  
 /mask cooldown  
 /mask reload

PERMISSIONS:
 mask.admin
 mask.use
 mask.give
 mask.reload

CONFIG:
Create a detailed config.yml containing all mask settings.

Example:

masks:
  asteroid:
    enabled: true
    cooldown: 60
    energy-cost: 80
    damage: 25
    radius: 6
    block-damage: false
    pvp: true

  magnetic:
    enabled: true
    cooldown: 20
    energy-cost: 30
    radius: 10

Make every important value configurable.

CODE QUALITY:
- Use clean object-oriented Java.
- Separate mask abilities into individual classes.
- Use an interface such as MaskAbility.
- Use Bukkit/Paper event listeners properly.
- Avoid unnecessary repeating tasks.
- Cancel scheduled tasks when players disconnect.
- Avoid memory leaks.
- Avoid excessive particle spawning that can cause server lag.
- Use efficient entity searches.
- Add comments explaining important systems.

FILES:
Provide the COMPLETE project:

MaskPowers/
β”œβ”€β”€ build.gradle
β”œβ”€β”€ settings.gradle
β”œβ”€β”€ gradle.properties
β”œβ”€β”€ src/
β”‚   └── main/
β”‚       β”œβ”€β”€ java/
β”‚       β”‚   └── .../
β”‚       β”‚       β”œβ”€β”€ MaskPowers.java
β”‚       β”‚       β”œβ”€β”€ commands/
β”‚       β”‚       β”œβ”€β”€ masks/
β”‚       β”‚       β”œβ”€β”€ abilities/
β”‚       β”‚       β”œβ”€β”€ listeners/
β”‚       β”‚       β”œβ”€β”€ managers/
β”‚       β”‚       └── utils/
β”‚       └── resources/
β”‚           β”œβ”€β”€ plugin.yml
β”‚           └── config.yml

IMPORTANT:
Do not give pseudocode.
Do not leave TODO sections.
Do not omit classes.
Give the complete compilable plugin source code.
Make sure all imports are correct for Paper 26.2-121.
Kodari AI
KodariSep 25 at 2:56 pm 2
MaskPowers
MaskPowers is a comprehensive Paper plugin that introduces ten unique magical masks, each granting players distinct superhero-style abilities like sky floating, magnetic force, asteroid summoning, gravity control, inferno, frozen domain, thunder strike, time freeze, void rift, and energy blast. Players equip masks in the helmet slot to activate powers, which consume energy and have configurable cooldowns. The plugin features a robust energy system, cinematic particle and sound effects, configurable balance settings for damage, radius, duration, and PvP, plus admin commands for mask distribution, energy management, and configuration reloading. It includes safety features like WorldGuard integration, world whitelisting, and prevention of permanent world destruction by default.
  1. Set up the Gradle/Paper plugin metadata and configurable mask definitions.

  2. Implement mask items, energy/cooldown management, commands, and safety listeners.

  3. Add separate working ability classes for all ten masks.

Created the MaskPowers project with Gradle setup, plugin metadata, configurable mask items, persistent energy and cooldowns, admin commands, safety listeners, and separate abilities for all ten masks. Block damage is disabled by default; optional WorldGuard checks are included.

I haven’t run a build, so compilation is not verified.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
23 1,406
src/main/java/com/kodari/maskpowers/MaskPowers.java
package com.kodari.maskpowers;

import com.kodari.maskpowers.abilities.AsteroidAbility;
import com.kodari.maskpowers.abilities.EnergyAbility;
import com.kodari.maskpowers.abilities.FireAbility;
import com.kodari.maskpowers.abilities.GravityAbility;
import com.kodari.maskpowers.abilities.IceAbility;
import com.kodari.maskpowers.abilities.MagneticAbility;
import com.kodari.maskpowers.abilities.SkyAbility;
import com.kodari.maskpowers.abilities.ThunderAbility;
import com.kodari.maskpowers.abilities.TimeAbility;
import com.kodari.maskpowers.abilities.VoidAbility;
import com.kodari.maskpowers.commands.MaskCommand;
import com.kodari.maskpowers.listeners.MaskListener;
import com.kodari.maskpowers.managers.MaskItemManager;
import com.kodari.maskpowers.managers.MaskManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public final class MaskPowers extends JavaPlugin {
    private MaskItemManager itemManager;
    private MaskManager maskManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        itemManager = new MaskItemManager(this);
        maskManager = new MaskManager(this);
        maskManager.register(new SkyAbility(this));
        maskManager.register(new MagneticAbility(this));
        maskManager.register(new AsteroidAbility(this));
        maskManager.register(new GravityAbility(this));
        maskManager.register(new FireAbility(this));
        maskManager.register(new IceAbility(this));
        maskManager.register(new ThunderAbility(this));
        maskManager.register(new TimeAbility(this));
        maskManager.register(new VoidAbility(this));
        maskManager.register(new EnergyAbility(this));
        Bukkit.getPluginManager().registerEvents(new MaskListener(this), this);
        MaskCommand command = new MaskCommand(this);
        Objects.requireNonNull(getCommand("mask"), "mask command missing from plugin.yml").setExecutor(command);
        Objects.requireNonNull(getCommand("mask")).setTabCompleter(command);
        maskManager.start();
    }

    @Override
    public void onDisable() {
        if (maskManager != null) {
            maskManager.shutdown();
        }
    }

    public MaskItemManager items() {
        return itemManager;
    }

    public MaskManager masks() {
        return maskManager;
    }
}