xenireloaded

create a hand and hand combat system like push punsch that knocks youy back or throw people very far

Kodari AI
KodariAug 25 at 10:29 pm 1
CombatPhysics
CombatPhysics is a Minecraft plugin introducing a dynamic hand-to-hand combat system with realistic physics-based interactions. Players can execute powerful punches that launch opponents backward with adjustable knockback force, and perform throws that send enemies flying across significant distances. The system features cooldown management to prevent spam, configurable damage values, particle effects for visual feedback, and sound effects for immersive combat. It includes permission-based access, anti-abuse mechanics to prevent excessive launching, and full configuration support for tuning knockback multipliers, throw distances, and cooldown durations. The plugin integrates seamlessly with existing combat mechanics while adding a new layer of physical interaction, making PvP encounters more dynamic and entertaining.
  • Create a Paper plugin project with Gradle and plugin metadata.

  • Add configurable fist-punch knockback, with sprinting punches throwing players much farther.

  • Register the listener and a /pushpunch reload command.

Created the PushPunch plugin from scratch.

Features:

  • Empty-handed punches knock back players.

  • Sprinting punches throw targets much farther.

  • Configurable horizontal and vertical knockback.

  • Punch cooldown to prevent excessive knockback.

  • /pushpunch reload command.

  • Permission: pushpunch.admin

Adjust knockback values in src/main/resources/config.yml.

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

import java.util.Objects;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class PushPunchPlugin extends JavaPlugin {

    private PunchListener punchListener;

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

        punchListener = new PunchListener(this);
        getServer().getPluginManager().registerEvents(punchListener, this);

        PluginCommand command = Objects.requireNonNull(getCommand("pushpunch"));
        PushPunchCommand pushPunchCommand = new PushPunchCommand(this);
        command.setExecutor(pushPunchCommand);
        command.setTabCompleter(pushPunchCommand);
    }

    public void reloadPluginConfig() {
        reloadConfig();
        punchListener.reload();
    }
}