Entity Attribute Reach Modification

Reach_Attribute_Modifier Reach HIGH +8 score

🎮 Minecraft Gameplay Impact

Prior to Minecraft 1.20.5, player interaction range and attack reach were hardcoded constants in client and server code (3.0 blocks for survival attacks, 4.5 for creative mode). Beginning with version 1.20.5, Mojang modularized these limits into native entity attributes: player.entity_interaction_range (PLAYER_ENTITY_INTERACTION_RANGE) and player.block_interaction_range (PLAYER_BLOCK_INTERACTION_RANGE).

Reach_Attribute_Modifier flags code that instantiates EntityAttributeModifier instances targeting these interaction range attributes. In a cheat scenario, a modification creates an attribute modifier (for example, with an addition operation mode) and applies it to the local player's attribute container. This boosts the maximum reach threshold recognized by the client engine without needing to directly patch raycasting methods or bytecode instructions in ClientPlayerInteractionManager.

On servers running vanilla attribute validation or anticheats that enforce server-side distance checks, client-side attribute changes that are not mirrored by server attributes will result in server packet rejections or silent hit cancellations.

🔍 Functions & APIs Analyzed

EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE / field_51576

Vanilla attribute registry entry introduced in Minecraft 1.20.5 governing entity attack reach.

EntityAttributeModifier.<init> / class_1322.<init>

Constructor for attribute modifiers adding permanent or temporary value adjustments to player attributes.

💻 Mod Implementation (Dev Source / Mapped)

package com.example.reach;

import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;

public class AttributeReachUtil {
    private static final Identifier REACH_MODIFIER_ID = Identifier.of("reach_boost", "attack_range");

    public static void applyExtendedReach(PlayerEntity player, double extraBlocks) {
        var attributeInstance = player.getAttributeInstance(EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE);
        if (attributeInstance != null) {
            EntityAttributeModifier modifier = new EntityAttributeModifier(
                REACH_MODIFIER_ID,
                extraBlocks,
                EntityAttributeModifier.Operation.ADD_VALUE
            );
            attributeInstance.removeModifier(REACH_MODIFIER_ID);
            attributeInstance.addTemporaryModifier(modifier);
        }
    }
}

🛡️ Bytecode Signature & Static Detection

The detector inspects class constant pool references, requiring two concurrent conditions within the same class:

  • A field reference to entity or block interaction range attributes: Intermediary class_5132.field_51574 (PLAYER_BLOCK_INTERACTION_RANGE), class_5132.field_51576 (PLAYER_ENTITY_INTERACTION_RANGE), named references ENTITY_INTERACTION_RANGE, BLOCK_INTERACTION_RANGE, Forge attribute ForgeMod.REACH_DISTANCE, or library attributes ReachEntityAttributes.REACH / ATTACK_RANGE.
  • An invocation of the attribute modifier constructor: EntityAttributeModifier.<init> (Intermediary class_1322.<init>) or Forge AttributeModifier.<init>.

The detector operates at class scope. Because the rule specifically checks for instantiating an EntityAttributeModifier alongside reach attribute fields, direct reflection calls or modifications made solely via network packet injection without constructor references will not trigger this signature.