Description
MPCombatLog - Hytale Combat Logging Prevention Plugin
This mod ensures no player leaves during a fight, and if they do - they will be killed on disconnect.
Features
- Automatic Combat Detection - Automatically detects when players take or deal damage
- Configurable Combat Duration - Set how long players stay in combat
- PvP/PvE Mode - Option to allow PvE combat logging
- Command Block - Block selected commands like /tp in combat!
- Combat Log Prevention - Kills players who disconnect while in combat
- Combat Status Messages - Customizable messages for entering/exiting combat
- Reload Command - Reload plugin from game! No need to restart the server
- Color Tags Support - Use &0-9 and &a-f for colors in config!(Minecraft Style)
- Developer API - Simple API for other plugins to check combat status
No CombatLog permission
If you do not want to get tagged in combat, use this permission combatlog.bypass
Configuration
Config is located at mods/MP_CombatLog/config.json:
{
"onlyPlayerDamageLog": true, , // Set to false to enable PvE combat logging
"combatTime": 30, // Time in seconds that players stay in combat
"showCombatTitle": true, // Set to false to disable combat title
"blockCommandsInCombat": true,
"blockedCommands": [
"home",
"spawn",
"tpa",
"tp",
"warp"
],
"messages": {
"prefix": "&l&7[&c&lCL&l&7] &7>> ",
"combatEnter": "&cYou have entered combat! &7Do not log out!",
"combatExit": "&aYou are no longer in combat.",
"combatTimeRemaining": "&6Combat: &e%seconds%s &7remaining",
"combatLogBroadcast": "&e%player% &cwas killed for combat logging!",
"commandBlocked": "&cYou cannot use this command while in combat!",
"commandReloadSuccess": "&aConfig reloaded successfully!",
"commandReloadFailed": "&cFailed to reload config: %error%",
"commandInfo": "&7Running &eMPCombatLog &7v%version%",
"combatTitleMain": "&cIN COMBAT",
"combatTitleSub": "&7%seconds%s remaining"
}
}
Commands
| Command | Description | Permission |
|---|---|---|
/combatlog |
Show plugin info | Everyone |
/combatlog help |
Show available commands | Everyone |
/combatlog reload |
Reload configuration | Ops only |
Developer API
MPCombatLog provides a simple API for other plugins to check and manage combat status.
Adding as Dependency
Maven
Add MPCombatLog as a dependency in your pom.xml:
<dependency>
<groupId>com.minimalpulse.combatlog</groupId>
<artifactId>MPCombatLog</artifactId>
<version>1.1.0</version>
<scope>provided</scope>
</dependency>
Hytale Manifest
Add MPCombatLog as a dependency in your manifest.json:
{
"Dependencies": {
"com.minimalpulse.combatlog": "*"
}
}
Or as an optional dependency if you want your plugin to work without it:
{
"OptionalDependencies": {
"com.minimalpulse.combatlog": "*"
}
}
API Usage
All API methods are static and accessible via CombatLogAPI:
import com.minimalpulse.combatlog.api.CombatLogAPI;
// Check if the plugin is loaded
if (CombatLogAPI.isAvailable()) {
// Plugin is loaded and ready
}
// Check if a player is in combat
UUID playerUuid = player.getUuid();
if (CombatLogAPI.isInCombat(playerUuid)) {
player.sendMessage(Message.raw("You can't do that while in combat!"));
return;
}
// Get remaining combat time in seconds
int secondsLeft = CombatLogAPI.getRemainingCombatTime(playerUuid);
// Get the configured combat duration
int combatDuration = CombatLogAPI.getCombatDuration();
// Manually put a player into combat
CombatLogAPI.enterCombat(playerUuid, worldName);
// Manually remove a player from combat
CombatLogAPI.exitCombat(playerUuid);
API Methods
| Method | Description | Returns |
|---|---|---|
isAvailable() |
Check if MPCombatLog is loaded | boolean |
isInCombat(UUID) |
Check if player is in combat | boolean |
getRemainingCombatTime(UUID) |
Get seconds remaining in combat | int |
getCombatDuration() |
Get configured combat duration | int |
enterCombat(UUID, String) |
Put player in combat with world tracking | void |
exitCombat(UUID) |
Remove player from combat | void |
License
MIT License - Feel free to use in your own projects!
Author
MinimalPulse


