Language

In Combat

In Combat

Modrinth

Detect when the player is in combat and prevent actions! Highly configurable & with mod integrations!

325 downloads 8 followers updated 4mo ago
latest v1.0.4 Modrinth
Fabric 1.20.1 – 1.20.1 Game-mechanicsUtility

In Combat

banner image
discord_link_badge
Static Badge

Static Badge
Static Badge

Installation

Requires

Features ✨

Becoming "In Combat"

There are a few ways the player can become in combat

  • Receiving damage
  • Dealing damage
  • Having a specific status effect

When "In Combat"

The player will have HUD element indicating that they are in combat.

When the player is in combat the following rules may apply.

  • Death on disconnect
  • Disable natural regeneration (disabled by default)
  • Disable block breaking/placing (disabled by default)

Configuration ⚙️

Basically everything is configurable inside the mod.

General
  • "In Combat" duration (default = 300 ticks -> 15 seconds)
  • Player should die on disconnect (default = true)
  • Disable natural regeneration (default = false)
  • Disable block breaking (default = false)
  • Block breaking whitelist
  • Disable block placing (default = false)
  • Block placing whitelist
  • Always "In Combat" (default = false)
  • Can become "In Combat" while in creative (default = false)
  • Which damage sources should set the player "In Combat"
    • All (default = false)
    • Player (default = true)
    • Any Entity (default = true)
    • Fire (default = true)
    • Fall Damage (default = false)
    • Dragon Breath (default = true)
  • If effects should set the player "In Combat" (default = true)
  • A list of all the effects that set the player "In Combat"
  • Additional effects that the player gets when "In Combat"
  • Attacking sets the player "In Combat"
  • Attacked entities that do not set the player "In Combat"
HUD Renderer
  • Should the HUD render (default = true)
  • X Offset (default = 0)
  • Y Offset (default = 0)
Mod Integrations
  • A config option to enable/disable each mod integration

Mod Integrations

Waystones

  • Prevents teleporting while in combat

Spell Engine

  • Spells are cost free to cast while out of combat

Suggest integrations in the Discord!

Technical Info

Anyone can check if the player is in combat using the in combat API. Add this project to your mod with
the Modrinth Maven. Once added checks can be done
like following

if(CombatCheck.isPlayerInCombat(PlayerEntity)){
  //Your code goes here...
}

Versions

Release
1.0.4
fabric · 1.20.1 · 4mo ago
# V1.0.4 ### Added - ### Changed - ### Fixed - Fixed an issue where food would always deplete rapidly (hopefully) # V1.0.3 ### Added - Blacklist for entities…
57
Release
1.0.3
fabric · 1.20.1 · 6mo ago
# V1.0.3 ### Added - Blacklist for entities that you attack that do not cause you to be in combat - Config option to add additional effects when the player…
59
Release
1.0.2
fabric · 1.20.1 · 6mo ago
# V1.0.2 ### Added - Option to become In Combat when dealing damage - Whitelist for block breaking and placing - Comes with default BOMD compat - Spell…
22
Release
1.0.1
fabric · 1.20.1 · 9mo ago
# V1.0.1 ### Fixed - ### Added - Config for option for die on disconnect - Block breaking & placing disabling while in combat (disabled by default) ###…
133
Release
1.0.0
fabric · 1.20.1 · 10mo ago
# V1.0.0 - Initial release
54

Comments 0

No comments yet. Be the first to share your thoughts.

Download In Combat

Files are served directly from the original source. Modgrid does not host or modify them.