anoomm__
📎 1 file 1,766 chars
📄
pasted-code-1783116884400.txt
txt 81 lines
â–¶
Create a Minecraft plugin for **Paper/Spigot 1.21.1** using **Java 21**.

## Plugin Information

* Plugin name: **DripstoneHit**
* Minecraft version: **1.21.1**
* Server software: **Paper**
* Java version: **Java 21**

## Features

* Add the command:

  ```
  /dripstonehit set 
  ```
* This command changes the **damage dealt by falling pointed dripstone (falling stalactites)**.
* The damage value should update immediately without requiring a server restart or reload.
* Higher values increase the damage, lower values decrease it.
* The plugin must only affect **falling pointed dripstone damage** and must not modify any other damage source.

## Permissions

* Permission required to use the command:

  ```
  dripstonehit.admin
  ```
* Players without the permission should receive:

  ```
  You do not have permission to use this command.
  ```
* The console should always be able to use the command.

## Configuration

* Save the damage value in `config.yml`.
* Load the value automatically on server startup.
* If `config.yml` does not exist, create it with a default damage value (for example, 40).

Example:

```yaml
damage: 40
```

## Command Behavior

Example:

```
/dripstonehit set 25
```

Response:

```
Damage set to 25.
```

Handle:

* Missing arguments.
* Invalid numbers.
* Negative values.
* Decimal numbers (only integers should be accepted).

## Technical Requirements

* Use the Paper API.
* Use Java 21.
* Include:

  * Complete Java source code.
  * `plugin.yml`.
  * `config.yml`.
  * Gradle or Maven project.
* The project must compile without errors and be ready to build into a JAR.
* Register the command and permission correctly in `plugin.yml`.
Kodari AI
KodariJul 3 at 10:22 pm 7
DripstoneHit
A Paper plugin that allows server administrators to configure the damage dealt by falling pointed dripstone stalactites. Features a command to set damage values, real-time updates without server reloads, and configurable default values. Only affects falling dripstone damage and leaves all other damage sources untouched.

I’ll create the DripstoneHit plugin project with all required files.

Creating the DripstoneHit plugin — a complete Paper 1.21.1 project with build system, config, command, and damage listener.

DripstoneHit
A Paper plugin that lets server administrators configure falling pointed dripstone damage. Provides a command to set the damage value with instant application, no reload needed. Saves the value in config.yml and loads it on startup. Only affects FALLING_STALACTITE damage, leaving all other damage sources untouched.
anoomm__

The compilation failed with this error:

code
Compilation failed with 1 error(s):

ERROR in src/main/java/com/dripstonehit/listener/DripstoneDamageListener.java at line 18: cannot find symbol
        if (event.getCause() != EntityDamageEvent.DamageCause.FALLING_STALACTITE) {
                                                             ^
  symbol: variable FALLING_STALACTITE
  location: class DamageCause


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/dripstonehit/listener/DripstoneDamageListener.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJul 3 at 10:26 pm 3

Let me check the build setup and API availability.

Let me check the actual constants available in the Paper 1.21.1 API.

The issue is likely the API version string. Let me check the correct Paper API artifact version.

The DamageCause.FALLING_STALACTITE constant was removed in the Paper 1.21 API. I’ll use the more robust entity-type check instead — detecting the FallingBlock entity with PointedDripstone block data.

Fixed. The DamageCause.FALLING_STALACTITE constant wasn’t available in the Paper 1.21.1 API. The listener now checks for a FallingBlock entity carrying PointedDripstone block data — same effect, no missing enum dependency.

Kodari can make mistakes. Review important code before using.
Files
gradle
src
build.gradle
settings.gradle
Code
8 195
src/main/java/com/dripstonehit/DripstoneHit.java
package com.dripstonehit;

import com.dripstonehit.command.DripstoneCommand;
import com.dripstonehit.listener.DripstoneDamageListener;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class DripstoneHit extends JavaPlugin {

    private int damage;

    @Override
    public void onEnable() {
        loadConfig();
        registerCommand();
        registerListener();
        getLogger().info("DripstoneHit enabled. Damage set to " + damage);
    }

    @Override
    public void onDisable() {
        getLogger().info("DripstoneHit disabled.");
    }

    private void loadConfig() {
        saveDefaultConfig();
        reloadConfig();
        damage = getConfig().getInt("damage", 40);
    }

    private void registerCommand() {
        DripstoneCommand executor = new DripstoneCommand(this);
        getCommand("dripstonehit").setExecutor(executor);
    }

    private void registerListener() {
        DripstoneDamageListener listener = new DripstoneDamageListener(this);
        Bukkit.getPluginManager().registerEvents(listener, this);
    }

    public int getDamage() {
        return damage;
    }

    public void setDamage(int damage) {
        this.damage = damage;
        getConfig().set("damage", damage);
        saveConfig();
    }
}