jay_inyogirlsdmz_26339

make a plugin that make it so when a player gets hit by another player in the last 30 second if they log out the player who logged out loot and armor drops on the floor and when they log in they die

Kodari AI
KodariJul 21 at 5:05 am 4
CombatLogout
CombatLogout protects servers from combat logging by tracking players who are damaged by other players. A player remains combat-tagged for 30 seconds after being hit. If they disconnect during this period, all inventory items, armor, and off-hand contents drop naturally at their last location, and their UUID is saved for recovery across restarts. When they rejoin, the plugin kills them immediately, allowing normal death handling and preventing combat-log abuse.
jay_inyogirlsdmz_26339

make it so if for the minecraft version is 1.21.11

Kodari AI
KodariJul 21 at 5:12 am 2
  1. Update the build target and plugin metadata for Minecraft 1.21.11.

  2. Adjust any version-sensitive code or configuration while preserving the combat-logout behavior.

  1. Updated the Paper API dependency to 1.21.11-R0.1-SNAPSHOT.

  2. Updated Java compatibility from Java 17 to Java 21.

  3. Updated plugin.yml to use api-version: '1.21'.

  4. The combat logout behavior remains configured for 30 seconds.

jay_inyogirlsdmz_26339

ty kodari

Kodari AI
KodariJul 21 at 5:15 am 1

You’re welcome!

jay_inyogirlsdmz_26339

how do i use or enable this in my server

Kodari AI
KodariJul 21 at 5:16 am 1
  1. Build the plugin:

Shell
./gradlew build

On Windows:

Shell
gradlew.bat build

The plugin JAR will be in:

Plain Text
build/libs/
  1. Copy the generated .jar file into your server’s:

Plain Text
plugins/
  1. Make sure your server is running Minecraft/Paper 1.21.11 with Java 21.

  2. Restart the server completely. Do not use /reload.

  3. Confirm it loaded:

Plain Text
/plugins

CombatLogout should appear in green. You can also check the server console for errors.

The plugin has no command or permission required. It automatically works as follows:

  • A player is hit by another player.

  • They remain combat-tagged for 30 seconds.

  • If they disconnect during those 30 seconds, their inventory, armor, and off-hand item drop at their logout location.

  • When they rejoin, they are killed by the plugin.

  • If they survive for 30 seconds without being hit again, logging out is safe.

The generated configuration is located at:

Plain Text
plugins/CombatLogout/config.yml

After changing the configuration, restart the server for the changes to apply.

jay_inyogirlsdmz_26339

does this work on single player worlds with the essential mod that let freinds join

Kodari AI
KodariJul 21 at 5:44 am 1

No. It will not work in a normal single-player world hosted through the Essential mod.

The plugin requires a Paper or Spigot server. Essential’s friend-join feature hosts your Minecraft single-player world through a modded client, so Bukkit/Paper plugins are not loaded.

To use CombatLogout, you need to:

  1. Set up a Paper 1.21.x server using Java 21.

  2. Install the CombatLogout .jar in the server’s plugins folder.

  3. Have your friends join that Paper server instead of joining through Essential.

The plugin will work for players using Fabric, Forge, or other client-side mods as long as they connect to the Paper server.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
7 239
src/main/java/com/kodari/combatlogout/CombatLogoutPlugin.java
package com.kodari.combatlogout;

import org.bukkit.plugin.java.JavaPlugin;

public final class CombatLogoutPlugin extends JavaPlugin {

    private CombatManager combatManager;

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

        combatManager = new CombatManager(this);
        getServer().getPluginManager().registerEvents(new CombatListener(combatManager), this);
    }

    public CombatManager getCombatManager() {
        return combatManager;
    }
}