yama_tkd
📎 1 file 1,490 chars
📄
pasted-code-1774201307287.txt
txt 58 lines
▶
Create a Minecraft Spigot/Paper plugin (Java) that adds a custom Crossbow called "Frozen Crossbow".

Requirements:

The crossbow must have a custom name: "Frozen Crossbow"
When a player shoots the crossbow:


Replace the normal arrow with a custom projectile that looks like an Ice Block
As the projectile travels, it should leave behind a trail of ice/snow particles and temporary ice blocks
When the ice projectile hits a player:


Deal exactly 2 hearts of TRUE damage (ignore armor and effects)
When the projectile hits any block:


Transform all nearby blocks in a 5 block radius into:


Ice
Snow
Packed Ice
EXCEPT for:


Air
Bedrock
Black Concrete

Additional Behavior:

The ice transformation should feel natural (like spreading/freezing effect)
blocks will revert back to the normal after a few seconds (keep it optimized)

Cooldown:

The ability must have a 40-second cooldown
The ability must have a 40-second cooldown show it in the chat or the actiom bar whenever its in hand 

Technical Requirements:

Use modern Spigot/Paper API practices
Use PersistentDataContainer to identify the custom crossbow
Cancel or replace the default arrow behavior
Include proper null checks and prevent abuse
Optimize for multiplayer performance

Output:

Full main class
plugin.yml file
Well-commented code explaining each part

make it work in every dimension except pvp dimension
make it so only operators can get this using commands 

Kodari AI
KodariMar 22 at 5:44 pm 25,454 (v2)

I’ll create a Frozen Crossbow plugin with all the specified features.

FrozenCrossbow
A Minecraft plugin that adds a custom crossbow with ice-themed abilities. When fired, it shoots ice block projectiles that leave particle trails, deal true damage to players, and freeze nearby blocks temporarily. Features a 40-second cooldown system with visual feedback and dimension restrictions. Only server operators can obtain the weapon through commands.

Plugin created successfully!

The Frozen Crossbow plugin includes:

✅ Custom crossbow with ice-themed abilities and persistent data tracking
✅ Ice block projectiles that replace normal arrows
✅ Particle trails (snowflakes, clouds, snowballs) following the projectile
✅ True damage (4.0 = 2 hearts) ignoring armor when hitting players
✅ Block freezing in 5-block radius with natural spreading effect
✅ Automatic reversion of frozen blocks after 5+ seconds (optimized)
✅ 40-second cooldown with action bar display when holding the crossbow
✅ Dimension restriction - disabled in worlds containing “pvp” in the name
✅ Operator-only command /frozencrossbow [player] to obtain the weapon
✅ XSeries integration for cross-version compatibility (1.16+)
✅ Optimized performance with scheduled tasks and efficient block tracking

The plugin prevents freezing of air, bedrock, and black concrete, and automatically cleans up all frozen blocks on server shutdown.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
11 718
src/main/java/com/frozencrossbow/FrozenCrossbowPlugin.java
package com.frozencrossbow;

import com.frozencrossbow.command.GiveCrossbowCommand;
import com.frozencrossbow.listener.CrossbowShootListener;
import com.frozencrossbow.listener.ProjectileHitListener;
import com.frozencrossbow.manager.BlockReversionManager;
import com.frozencrossbow.manager.CooldownManager;
import com.frozencrossbow.manager.ItemManager;
import com.frozencrossbow.task.CooldownDisplayTask;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class FrozenCrossbowPlugin extends JavaPlugin {
    
    private ItemManager itemManager;
    private CooldownManager cooldownManager;
    private BlockReversionManager blockReversionManager;
    
    @Override
    public void onEnable() {
        this.itemManager = new ItemManager(this);
        this.cooldownManager = new CooldownManager();
        this.blockReversionManager = new BlockReversionManager(this);
        
        registerCommands();
        registerListeners();
        startTasks();
        
        getLogger().info("FrozenCrossbow plugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (blockReversionManager != null) {
            blockReversionManager.revertAllBlocks();
        }
        getLogger().info("FrozenCrossbow plugin has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("frozencrossbow").setExecutor(new GiveCrossbowCommand(this));
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new CrossbowShootListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ProjectileHitListener(this), this);
    }
    
    private void startTasks() {
        new CooldownDisplayTask(this).runTaskTimer(this, 0L, 10L);
    }
}