Sueta

NoMoreCombatLog

1.0.7

Plugin that stops Combat Logging

·Plugin

NoMoreCombatLog

A simple and configurable Paper plugin that prevents players from combat logging.


Features

  • Players are placed in combat when attacking or being attacked.
  • The combat duration can be configured.
  • Combat time can be displayed using an action bar, boss bar, or title.
  • Players who disconnect during combat can be punished.
  • Multiple punishments can be used at the same time.
  • Players can be prevented from using portals and ender pearls during combat.
  • Commands can be blocked during combat.
  • Command blacklist and whitelist modes are supported.
  • Combat can be disabled in specific worlds.
  • Combat in creative mode can be enabled or disabled.
  • Join and respawn grace periods are supported.
  • Active combat tags are saved across server restarts.
  • Messages can be changed in messages.yml.
  • Admin commands include tab completion.
  • PlaceholderAPI support is available.
  • Old configurations are migrated automatically.

Retaliation Mode

Retaliation mode can be enabled if you only want mutual combat to start after a player fights back.

The first attacker can optionally be tagged immediately.

Safe Zones

You can create safe zones where players cannot start combat.

Safe zones can be spherical or cuboid and can:

  • Prevent combat.
  • Remove active combat tags when entered.

Existing radius-based safe zones are still supported.

Combat Displays

The combat display can be changed in the config:

display:
  type: ACTION_BAR

Available display types:

ACTION_BAR
BOSS_BAR
TITLE
NONE

Punishments

The following punishment types are supported:

KILL
BAN
TEMPBAN
COMMAND
DROP_INVENTORY
DROP_EXPERIENCE

Multiple punishment actions can be combined.

Config

config-version: 4

plugin:
  enabled: true

combat:
  duration: 30s
  creative-mode: false

  retaliation:
    enabled: false
    window: 10s
    tag-attacker-immediately: true

  grace-period:
    join: 5s
    respawn: 3s
    mutual: true

  damage-sources:
    melee: true
    projectiles: true
    arrows: true
    tridents: true
    other-player-caused-damage: true

display:
  type: ACTION_BAR

commands:
  mode: BLACKLIST
  list:
    - home
    - spawn
    - warp
    - tpa

teleport:
  portals: false
  ender-pearls: false

worlds:
  disabled:
    - world_the_end

safe-zones:
  enabled: false
  remove-combat-on-entry: false

punishment:
  enabled: true
  actions:
    - type: KILL

integrations:
  placeholder-api: true

debug:
  enabled: false

Durations can be written like this:

30s
5m
2h
1d
1h30m

Commands

CommandPermissionDescription
/nmcl tag <player> [duration]nomorecombatlog.admin.tagTags a player
/nmcl untag <player>nomorecombatlog.admin.untagRemoves a combat tag
/nmcl status <player>nomorecombatlog.admin.statusShows a player's combat status
/nmcl extend <player> <duration>nomorecombatlog.admin.extendExtends a combat tag
/nmcl listnomorecombatlog.admin.listLists active combat tags
/nmcl tagall [duration]nomorecombatlog.admin.tagallTags all eligible players
/nmcl untagallnomorecombatlog.admin.untagallRemoves all combat tags
/nmcl debug <player>nomorecombatlog.admin.debugShows detailed player information
/nmcl reload [config|messages|all]nomorecombatlog.admin.reloadReloads the plugin
/nmcl safezone add <name> <radius>nomorecombatlog.safezone.addAdds a radius safe zone
/nmcl safezone cuboid <name> <positions>nomorecombatlog.safezone.addAdds a cuboid safe zone
/nmcl safezone info <name>nomorecombatlog.safezone.listShows safe-zone information
/nmcl safezone listnomorecombatlog.safezone.listLists all safe zones
/nmcl safezone remove <name>nomorecombatlog.safezone.removeRemoves a safe zone

nomorecombatlog.admin gives access to all admin commands.

PlaceholderAPI

The following placeholders are available:

%nmcl_in_combat%
%nmcl_combat_time%
%nmcl_combat_time_seconds%
%nmcl_opponent%
%nmcl_reason%

PlaceholderAPI is optional. The plugin works normally without it.

Developer API

NoMoreCombatLog provides a public API for other plugins.

The API can be used to:

  • Check whether a player is in combat.
  • Get their remaining combat time.
  • Get their current opponent and combat reason.
  • Tag, extend, or untag players.
  • Listen for combat start, refresh, end, and combat-log events.

Example:

NMCLApi api = NoMoreCombatLog.getAPI();

if (api.isInCombat(player.getUniqueId())) {
    Duration remaining = api.getRemainingTime(player.getUniqueId());
}

api.tag(player, Duration.ofSeconds(30));
api.untag(player);

Available events:

PlayerCombatStartEvent
PlayerCombatRefreshEvent
PlayerCombatEndEvent
PlayerCombatLogEvent

If you find a bug or have a feature request, please report it on the issue tracker.

Similar projects

Plugin →