Client-Side Trap Entity Despawner (AntiTrap)

Anti_Trap_Entity_Despawn Exploits HIGH +8 score

🎮 Minecraft Gameplay Impact

Despawns Armor Stands and Minecarts from the client-side world via Entity.remove(), removing raycast and crosshair obstructions so the player can attack enemies, place crystals, and throw ender pearls unhindered through entity-spam traps.

🔍 Functions & APIs Analyzed

Entity.remove

Forced client-side entity despawn method.

EntityType.ARMOR_STAND

Target trap entity type typically placed to block attacks or trigger traps.

💻 Mod Implementation (Dev Source / Mapped)

// Developer Source (Fabric / Yarn mappings)
public class AntiTrap {
    public static void clearTraps(ClientWorld world) {
        world.getEntities().forEach(e -> {
            if (e.getType() == EntityType.ARMOR_STAND || e.getType() == EntityType.MINECART) {
                e.remove(Entity.RemovalReason.KILLED);
            }
        });
    }
}

⚙️ Decompiled Representation (Vineflower View)

// Decompiled with Vineflower 1.12 (Intermediary mappings)
public class AntiTrap {
    public static void clearTraps(class_638 world) {
        world.method_18112().forEach(e -> {
            if (e.method_5864().equals(class_1299.field_6131)) {
                e.method_5650(class_5529.field_26999);
            }
        });
    }
}

🛡️ Bytecode Signature & Static Detection

Matches Entity.remove (method_5650) with RemovalReason and ArmorStand/Minecart EntityType references.