ibrahim rahman

Build a paper 1.21.11 plugin that disables the use of riptide trident in combat syncing with PvPmanager

Kodari AI
KodariOct 10 at 10:04 am 1
RiptideDisabler
Disables riptide trident usage during combat when PvPManager marks a player as in PvP. Listens to PlayerRiptideEvent and cancels the riptide launch if the player is flagged by PvPManager's PvP API. Provides configurable messages and optional permission bypass. Integrates seamlessly with PvPManager's combat synchronization, preventing players from using riptide tridents to escape or exploit combat situations. Lightweight Paper plugin with minimal overhead, supporting Paper 1.21.11 and PvPManager's latest API. Includes automatic PvPManager dependency detection and graceful fallback if PvPManager is not present.
  1. Create the Paper 1.21.11 project and plugin metadata.

  2. Cancel riptide activation when PvPManager reports the player in combat, querying its API reflectively so PvPManager is optional at compile time.

Created the Paper 1.21.11 plugin. It cancels PlayerRiptideEvent when PvPManager reports the player is combat-tagged; PvPManager is an optional soft dependency and is queried reflectively, so it is not a compile-time dependency. A message is sent when riptide is blocked.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 222
src/main/java/com/kodari/riptidecombat/RiptideCombatPlugin.java
package com.kodari.riptidecombat;

import org.bukkit.plugin.java.JavaPlugin;

public final class RiptideCombatPlugin extends JavaPlugin {
    private PvPManagerCombatLookup combatLookup;

    @Override
    public void onEnable() {
        combatLookup = new PvPManagerCombatLookup(this);
        getServer().getPluginManager().registerEvents(new RiptideListener(combatLookup), this);

        if (getServer().getPluginManager().getPlugin("PvPManager") == null) {
            getLogger().warning("PvPManager was not found; riptide restrictions are inactive until it is installed.");
        }
    }
}