Skip to content

InteractionCompat ​

com.jsmacrosce.jsmacros.client.util.InteractionCompat

Calls the entity-interaction overload across Minecraft API versions.

On Minecraft 26.1 and later, constructs an EntityHitResult for the entity;
earlier versions pass the entity directly.

Methods ​

interact ​

static interact(MultiPlayerGameMode gameMode, Player player, Entity entity, InteractionHand hand): InteractionResult#
Delegates to the supplied game mode's entity-interaction API. On Minecraft 26.1 and later, the hit result is constructed from entity rather than supplied by the caller.

Parameters:

  • gameMode: the non-null client game-mode controller handling the interaction
  • player: the non-null interacting player
  • entity: the non-null target entity
  • hand: the non-null hand to use
Returns: the interaction result returned by the game mode; this does not indicate server acceptance