AntiSwap (Attribute Swap Fix)

Quick rating

AntiSwap (Attribute Swap Fix)

No reviews yet

Prevents players from using attribute swap exploits by fast-swapping items to their offhand. Highly configurable and perfect for Modpack, PvP and SMP servers!

QoL & Tweaks
Bug Fixes
Mod Loaders
Forge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Unsupported
Server Required

About

Project Details

Type
Mod
License
All Rights Reserved
Latest Version
antiswapfix-1.1.0.jar
Authors
CurseForge
Modrinth

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

Overview

Anti-Swap Fix addresses a critical combat exploit where players can swap weapons mid-attack to gain unintended attribute bonuses. This exploit allows players to combine the attack speed of one weapon with the damage or attributes of another, creating an unfair advantage in PvP and PvE scenarios.

This mod was specifically designed for large modpack SMPs where players have access to weapons with unique attributes and special effects. In these environments, the exploit becomes particularly problematic as players can mix and match powerful modded weapon attributes, completely breaking the intended game balance and progression systems.

The Problem

In vanilla Minecraft, when a player initiates an attack, the game calculates damage and applies attributes based on the item held at the moment the attack connects, not when it was initiated. This creates a window of opportunity where players can:

  1. Start an attack with a fast weapon (e.g., dagger with high attack speed)
  2. Swap to a powerful weapon mid-attack (e.g., sword with high damage)
  3. Deal damage with the powerful weapon while maintaining the attack speed of the fast weapon

This exploit is commonly known as "Attribute Swap" or "Weapon Swap" and can severely impact game balance, especially on servers with custom weapons or RPG-style combat systems.

How It Works

Anti-Swap Fix uses a simple but effective approach:

  1. Snapshot System: At the start of each player tick, the mod records which item the player is holding
  2. Attack Validation: When a player attempts to attack, the mod compares the current held item with the snapshot
  3. Exploit Prevention: If the items don't match, the attack is cancelled

This "snapshot-and-validate" strategy ensures that players can only deal damage with the weapon they were actually holding when they initiated the attack.

Features

  • Server-Side Only: No client installation required
  • Lightweight: Minimal performance impact with efficient snapshot caching
  • Configurable: Enable/disable protection via server config or commands
  • Debug Mode: Optional per-player debug messages for testing and verification
  • Zero False Positives: Only cancels attacks when an actual swap is detected

Configuration

The mod creates a configuration file at config/antiswapfix-server.toml with the following options:

[General Settings]
    # Enables protection against the Attribute Swap exploit
    enabled = true

    # Sends debug messages to players when attacks are cancelled
    debugMode = false

Commands

All commands require operator permission (level 2).

Toggle Protection

/antiswap toggle true/false

Enables or disables the anti-swap protection.

Toggle Debug Mode

/antiswap debug true/false

Enables or disables debug messages for the player who executes the command. When enabled, you will receive detailed messages showing which items were swapped when an attack is cancelled.

Debug messages show:

  • The item held at the start of the tick
  • The item held when the attack was attempted
  • Color-coded information for easy identification

Compatibility

  • Minecraft Version: 1.20.1
  • Mod Loader: Forge 47.4.10+
  • Side: Server-side (client installation optional but not required)

Why This Mod?

In large modpack environments, the Attribute Swap exploit becomes exponentially more dangerous. Players can exploit combinations of:

  • High attack speed weapons from one mod with high damage weapons from another
  • Weapons with special effects combined with weapons that have high base damage
  • Enchantments and custom attributes that were never meant to work together A player with a fast dagger and a powerful greatsword can effectively have both at once, trivializing boss fights and making PvP completely unbalanced. Anti-Swap Fix provides a clean, universal solution that works with any item, any mod, and any combat system. It doesn't care about attributes, enchantments, or special effects - it simply ensures you attack with the weapon you're actually holding.

Credits

Author: SatDPhoe

ko-fi

Donate

Overview

Anti-Swap Fix addresses a critical combat exploit where players can swap weapons mid-attack to gain unintended attribute bonuses. This exploit allows players to combine the attack speed of one weapon with the damage or attributes of another, creating an unfair advantage in PvP and PvE scenarios.

This mod was specifically designed for large modpack SMPs where players have access to weapons with unique attributes and special effects. In these environments, the exploit becomes particularly problematic as players can mix and match powerful modded weapon attributes, completely breaking the intended game balance and progression systems.

The Problem

In vanilla Minecraft, when a player initiates an attack, the game calculates damage and applies attributes based on the item held at the moment the attack connects, not when it was initiated. This creates a window of opportunity where players can:

  1. Start an attack with a fast weapon (e.g., dagger with high attack speed)
  2. Swap to a powerful weapon mid-attack (e.g., sword with high damage)
  3. Deal damage with the powerful weapon while maintaining the attack speed of the fast weapon

This exploit is commonly known as "Attribute Swap" or "Weapon Swap" and can severely impact game balance, especially on servers with custom weapons or RPG-style combat systems.

How It Works

Anti-Swap Fix uses a simple but effective approach:

  1. Snapshot System: At the start of each player tick, the mod records which item the player is holding
  2. Attack Validation: When a player attempts to attack, the mod compares the current held item with the snapshot
  3. Exploit Prevention: If the items don't match, the attack is cancelled

This "snapshot-and-validate" strategy ensures that players can only deal damage with the weapon they were actually holding when they initiated the attack.

Features

  • Server-Side Only: No client installation required
  • Lightweight: Minimal performance impact with efficient snapshot caching
  • Configurable: Enable/disable protection via server config or commands
  • Debug Mode: Optional per-player debug messages for testing and verification
  • Zero False Positives: Only cancels attacks when an actual swap is detected

Configuration

The mod creates a configuration file at config/antiswapfix-server.toml with the following options:

[General Settings]
    # Enables protection against the Attribute Swap exploit
    enabled = true

    # Sends debug messages to players when attacks are cancelled
    debugMode = false

Commands

All commands require operator permission (level 2).

Toggle Protection

/antiswap toggle true/false

Enables or disables the anti-swap protection.

Toggle Debug Mode

/antiswap debug true/false

Enables or disables debug messages for the player who executes the command. When enabled, you will receive detailed messages showing which items were swapped when an attack is cancelled.

Debug messages show:

  • The item held at the start of the tick
  • The item held when the attack was attempted
  • Color-coded information for easy identification

Compatibility

  • Minecraft Version: 1.20.1
  • Mod Loader: Forge 47.4.10+
  • Side: Server-side (client installation optional but not required)

Why This Mod?

In large modpack environments, the Attribute Swap exploit becomes exponentially more dangerous. Players can exploit combinations of:

  • High attack speed weapons from one mod with high damage weapons from another
  • Weapons with special effects combined with weapons that have high base damage
  • Enchantments and custom attributes that were never meant to work together A player with a fast dagger and a powerful greatsword can effectively have both at once, trivializing boss fights and making PvP completely unbalanced. Anti-Swap Fix provides a clean, universal solution that works with any item, any mod, and any combat system. It doesn't care about attributes, enchantments, or special effects - it simply ensures you attack with the weapon you're actually holding.

Credits

Author: SatDPhoe

ko-fi

Donate

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Total Downloads
CurseForge
<1,000
Modrinth
<1,000
Last Updated
CurseForge
Modrinth
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works