azectzz

make a duels plugin that when someone does /duel {player} it teleports then both to the "world" multiverse 10,000 blocks out from 0,0,0 and then fight, when someone kills another player they get the loot, when somone accpets the duel they both spawn 25 blocks above the ground and when they are falling, they got slow falling so they dont take fall damage and when they hit the ground the effect goes away

Kodari AI
KodariMay 5 at 9:59 pm 6,801 (v2)

I’ll create a PvP duels plugin with teleportation, slow falling mechanics, and loot transfer on kill.

DuelsPlugin
A PvP duels system that allows players to challenge each other to combat. When a duel is accepted, both players teleport 10,000 blocks out in the world and spawn 25 blocks above ground with slow falling effects. The effect automatically removes upon landing. Winners receive all loot from defeated opponents. Features automated arena teleportation and death handling with inventory transfer.

Created a complete duels plugin with the following features:

  • /duel <player> sends a challenge (60-second expiration)

  • /duel accept accepts the most recent challenge

  • Both players teleport to X=10000, Z=10000 in the “world” Multiverse world

  • Spawn 25 blocks above ground with slow falling effect

  • Effect automatically removes when landing

  • Winner receives all loser’s items on kill

  • Both players teleport back to original locations after duel

  • Handles player disconnects during duels

The plugin uses Lombok for clean data classes, XSeries for cross-version compatibility, and requires Multiverse-Core for world management.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
8 435
src/main/java/com/duels/plugin/DuelsPlugin.java
package com.duels.plugin;

import com.duels.plugin.commands.DuelCommand;
import com.duels.plugin.listener.DuelListener;
import com.duels.plugin.manager.DuelManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class DuelsPlugin extends JavaPlugin {

    private static DuelsPlugin instance;
    private DuelManager duelManager;

    @Override
    public void onEnable() {
        instance = this;
        
        this.duelManager = new DuelManager(this);
        
        getCommand("duel").setExecutor(new DuelCommand(this));
        getServer().getPluginManager().registerEvents(new DuelListener(this), this);
        
        getLogger().info("DuelsPlugin has been enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("DuelsPlugin has been disabled!");
    }

    public static DuelsPlugin getInstance() {
        return instance;
    }
}