Noble Adikwu
📎 1 file 2,484 chars
📄
pasted-code-1791406526095.txt
txt 52 lines
▶
Create a Minecraft Java Paper plugin for version 26.2 called **CodRiptide**.

### Core Feature

< Players can obtain a normal **Cod** item normally.
< If the Cod has **Riptide III** applied to it, it becomes a special usable item.
< When the player uses the Riptide III Cod **while in the air**, launch the player forward/upward exactly like using a **Riptide III Trident**.
< The Cod should NOT need to be in water or during rain. It must work while the player is completely in the air.
< The movement should closely replicate the normal Minecraft Riptide III trident movement.
< The Cod must remain a normal Cod when it does not have Riptide III.

### Cooldown

< Add a **1-second additional cooldown** to the Riptide ability.
< This should be added on top of the normal Riptide III cooldown behavior.
< Display a clear cooldown message/action-bar message if the player tries to use it before the cooldown is finished.
< The cooldown must be tracked per player.

### Enchantment Requirement

< The special ability ONLY activates if the Cod has **Riptide III**.
< Riptide I or II should not activate the ability.
< Other enchantments on the Cod should remain functional/unchanged.
< The Cod should visually/display as having Riptide III when inspected.

### Admin-Only Command

Add an admin-only command:

`/codriptide`

Command behavior:
< Only players with OP or the permission `codriptide.admin` can use the command.
< Give the command sender a Cod with **Riptide III**.
< Give it a custom name such as **Riptide Cod** using Minecraft formatting.
< Include tab completion where appropriate.
< If a normal player tries to use the command, deny access with a clear message.

### Important

< Do NOT replace or modify normal Cod items.
< Do NOT give players Riptide C
od automatically.
< The only way to obtain the special Riptide Cod should be through the admin command or by an admin manually applying Riptide III to a Cod.
< The plugin should detect the Riptide III enchantment rather than relying only on the custom item name.
< Prevent exploits such as triggering the ability multiple times during the same cooldown.
< Make it compatible with Paper 26.2.
< Make the implementation efficient and avoid unnecessary repeating tasks.
< Include a complete `plugin.yml`, main Java class, and all required Java classes.
< Make the code ready to compile and install directly into a Paper 26.2 server.
< Explain exactly where each file
Kodari AI
KodariOct 7 at 8:58 pm 2
CodRiptide
CodRiptide is a Paper plugin that transforms a normal Cod enchanted with Riptide III into a special usable item. When a player uses the Riptide Cod while airborne, they launch forward/upward exactly like using a Riptide III Trident, without requiring water or rain. The plugin adds a 1-second per-player cooldown on top of the normal Riptide behavior, displaying a clear action-bar message when the ability is not ready. The special ability only activates with Riptide III; Riptide I or II remains non-functional. An admin-only command `/codriptide` grants a custom-named Riptide Cod, with permission checks and tab completion. The plugin detects the enchantment directly, prevents cooldown exploits, and leaves normal Cod items completely untouched.

I’ll build CodRiptide as five Java classes plus plugin.yml and config.yml. The build config is already provided by the project template, so I’m not creating build.gradle.

Files where they and go (all paths relative to the project root):

File
Purpose
src/main/resources/plugin.yml
Registers the
/codriptide
command and the
codriptide.admin
permission (default: op).
src/main/resources/config.yml
cooldown-seconds
(1.0) and
launch-strength
(3.0).
src/main/java/com/example/codriptide/CodRiptide.java
Main class. Loads config, registers the listener and command.
src/main/java/com/example/codriptide/RiptideCod.java
Builds the Riptide Cod, detects it by the Riptide III enchantment, and provides the text helper.
src/main/java/com/example/codriptide/CooldownManager.java
Per-player cooldown timestamps. Entries are cleared on quit.
src/main/java/com/example/codriptide/RiptideCodListener.java
Right-click handling, cooldown check, launch, and blocking food use of the item.
src/main/java/com/example/codriptide/CodRiptideCommand.java
Admin command that gives the Riptide Cod.

How it behaves:

  • Detection: a Cod counts only if it has Riptide at exactly level III, so Riptide I/II and enchanted tridents don’t trigger it. The name is cosmetic.

  • Launch: the boost is the look direction times 3.0, added to current velocity. That matches vanilla’s Riptide III speed. It works in air, rain or not.

  • Cooldown: the 1-second cooldown starts before the launch, so repeat clicks in the same window are blocked. The action bar shows the remaining time.

  • Exploit guards: only the main hand is handled, which prevents double firing. Food use of the item is denied, so a hungry player can’t eat it.

  • Not reproduced: vanilla’s spin-attack damage and pose have no public Paper API here, so only the movement is matched.

  • Tab completion: /codriptide takes no arguments, so the completer returns an empty list.

  • Version: api-version is set to '1.21', a format Paper accepts across versions. If your 26.2 server reports an API-version mismatch, change it to the version string your server shows.

Compile with Compile in the top bar and download the jar from the build window. Put it in your server’s plugins/ folder.

Noble Adikwu

add riptide animation to it when using and an extra 1 second cd

Kodari AI
KodariOct 11 at 3:51 pm 1
  • Add a short, rotating splash-particle effect around the player on activation to suggest the Riptide spin.

  • Add one second to the configured cooldown, making the default effective cooldown two seconds.

Added a 10-tick rotating splash-particle animation when the Riptide Cod is used. The cooldown now adds a fixed extra second to the configured value, so the default effective cooldown is 2 seconds.

Kodari can make mistakes. Review important code before using.
Files
src
Code
7 269
src/main/java/com/example/codriptide/CodRiptide.java
package com.example.codriptide;

import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class CodRiptide extends JavaPlugin {

    @Override
    public void onEnable() {
        saveDefaultConfig();

        long cooldownMillis = Math.round(getConfig().getDouble("cooldown-seconds", 1.0) * 1000.0) + 1000L;
        double launchStrength = getConfig().getDouble("launch-strength", 3.0);

        CooldownManager cooldowns = new CooldownManager(cooldownMillis);
        Bukkit.getPluginManager().registerEvents(new RiptideCodListener(this, cooldowns, launchStrength), this);

        PluginCommand command = getCommand("codriptide");
        if (command == null) {
            getLogger().severe("Command 'codriptide' is missing from plugin.yml; disabling.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        CodRiptideCommand executor = new CodRiptideCommand();
        command.setExecutor(executor);
        command.setTabCompleter(executor);
    }
}