Combat Toggle
Combat Toggle: Compatibility & Ports
MC 1.19.2MC 1.20.1Forge~4 min read
On this page (5)
Combat Toggle has no required external mod dependencies on either 1.20.1 Forge or 1.19.2 Forge. This page covers multiplayer handshake rules, interactions with scoreboard/claims/automation mods, and version differences between the two Forge ports.
Side requirements & network protocol
| Port | Network protocol | Client required? | Vanilla clients allowed? | Dedicated-server safety |
|---|---|---|---|---|
1.20.1 Forge |
v4 (PROTOCOL::equals) |
Yes |
No (rejected at handshake) |
Strictly isolated client/ package verified by Gradle verifyServerSafety task |
1.19.2 Forge |
v2 (acceptMissingOr(PROTOCOL::equals)) |
No (optional) |
Yes ( displayTest = "IGNORE_SERVER_VERSION") |
@Mod.EventBusSubscriber(Dist.CLIENT) isolation + player.connection == null guards |
- 1.20.1
S2CSyncStatePacket(v4): Sendsenabled,tagRemainingSec,cooldownRemainingSec,cooldownBlocksNextToggle, andcooldownSourceso the HUD hides non-restricting cooldowns accurately. Clients on 1.x (protocol v3 or older) are rejected cleanly at handshake. - 1.19.2
S2CSyncStatePacket(v2): Sendsenabled,tagSec,cooldownSec,warmupSec, andpendingCombat(clamped to[0, 86400]seconds). Modded clients also sendC2SClientHelloPacketon login so the server knows whether to suppressclientModNoticeand display client versions in/combattoggle list//get.
Scoreboard & nameplate mods
Vanilla Minecraft allows each player to belong to at most one scoreboard team. When another mod (such as FTB Teams, factions, minigames, or permissions/tab plugins) manages scoreboard teams:
- On 1.20.1 Forge:
teamConflictPolicy = PRESERVE_EXISTING(default) automatically detects when a player is already on a team not owned by Combat Toggle (TeamOwnershipDataSavedData) and leaves that team untouched instead of displacing them.- Set
teamConflictPolicy = OVERRIDEif Combat Toggle should take precedence over external teams. - If a pre-existing manual or third-party team already uses
combatTeamNameorpeaceTeamName, Combat Toggle refuses to repaint it and disables nameplates for that session until renamed.
- On 1.19.2 Forge:
- Because
addPlayerToTeamevicts a player from any previous team, setuseScoreboardTeams = falseif another mod owns your scoreboard teams. Turning it off removes emptyct_combat/ct_peaceteams cleanly.
- Because
Automation, FakePlayers & modded damage
- Forge
FakePlayer(Create deployers, AE2, mechanical attackers):- On 1.20.1,
DamageAttributionverifies every resolved player againstserver.getPlayerList().getPlayer(uuid). SinceFakePlayerentities are not connected players in the player list, they are treated asUNATTRIBUTEDand never blocked or tagged as Peace players. - On 1.19.2, outbound packets (
PacketHandler.sendToPlayer) and messages (ServerFeedback.canReceive) explicitly guardplayer.connection == nullsoFakePlayerattackers never throw aNullPointerException.
- On 1.20.1,
- Modded summons & pets: Any entity implementing Forge/vanilla
OwnableEntityis resolved to its owner. On 1.20.1, ownership resolution walks up to8links with cycle detection so projectile → summon → player chains resolve safely. - Modded
DamageTypedenylist (1.20.1): Any vanilla or modded damage type ID (e.g.ars_nouveau:spell,irons_spellbooks:fire_magic,minecraft:magic) can be added toblockedDamageTypesincombattoggle-server.toml. Invalid resource locations are logged and ignored on load. - Custom mixin damage sources: Combat Toggle enforces PvP via
LivingAttackEvent(HIGHpriority) andLivingHurtEvent(LOWESTon 1.20.1; normal fallback on 1.19.2). Damage applied by another mod through a custom mixin that bypasses both events cannot be intercepted. - Unattributable vanilla mechanics:
- On 1.20.1, vanilla
SnowGolem(does not implementOwnableEntity),AreaEffectCloud, lingering potions, and environmental hazards (lava, cactus, flint & steel, suffocation) do not retain player attribution and are outside scope. - On 1.19.2, splash/lingering potions, area-effect clouds, fishing hooks, end crystals, TNT minecarts, beds, and respawn anchors are explicitly gated via
ProjectileGateandExplosionGate, while environmental traps remain out of scope (use a claims mod for block-grief protection).
- On 1.20.1, vanilla
Permissions & command integrations
- 1.19.2 Forge (
PermissionAPI): Registers 13 Boolean permission nodes (combattoggle.toggle,combattoggle.status,combattoggle.client,combattoggle.admin.get,.set,.tag,.untag,.resetcooldown,.resync,.reload,.list,.region,.offline) compatible with LuckPerms, FTB Ranks, and any ForgePermissionAPIprovider. - 1.19.2 root command literals:
/combatand/peacemay collide with other PvP or admin mods that register the same root names;/ctand/combattoggle <subcommand>are safer fallbacks. - 1.20.1 Forge: Uses configurable
adminPermissionLevel(0–4, default2) checked on every invocation.
Claims, minigame & penalty mod integration
Other mods can listen to Combat Toggle’s Forge bus events or call CombatToggleAPI directly on the server thread:
- Safe-zone / claims / arena mods: Cancel
CombatToggleStateChangeEvent(1.20.1) orCombatModeChangeEvent.Pre(1.19.2) to block toggling in protected zones; on 1.19.2 you can also cancel or adjustCombatTagEvent. - Combat-log penalty mods (1.20.1): Subscribe to
CombatLoggedOutEventand checkevent.isCombatLog()(tagRemainingTicks > 0) to apply custom disconnect penalties (on 1.19.2, this is built in viacombatLogAction). - Anti-cheat / logging mods (1.19.2): Subscribe to
PvpBlockedEventto inspect refused hits (ATTACKER_PEACE,VICTIM_PEACE,RESPAWN_PROTECTION,REGION,SPAWN_SAFE_ZONE).
See Pack Authors & API for method signatures and code examples.