Skip to content

PlayerInteractEvent is not triggered when entity_interaction_range is increased #13895

@loqqin

Description

@loqqin

Expected behavior

A PlayerInteractEvent with action = LEFT_CLICK_AIR must be triggered

Observed/Actual behavior

PlayerInteractEvent is not being triggered

Steps/models to reproduce

/attribute @p minecraft:entity_interaction_range base set 10
https://youtu.be/NhFysJaVHiA

Plugin and Datapack List

none

Paper version

the second-to-last one; it doesn't make sense

Other

This can be fixed by adding the same check as in hitEntity, but replacing entity with block and entityInteractionRange with blockInteractionRange.

else if (gameType != GameType.CREATIVE && result.getHitBlock() != null && origin.toVector().distanceSquared(result.getHitPosition()) > this.player.blockInteractionRange() * this.player.blockInteractionRange()) {
                CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.getInventory().getSelectedItem(), InteractionHand.MAIN_HAND);
            }

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions