When "Allow Interaction" is disabled, you can still attempt to interact. E.g. when left-clicking, a use hand animation will play as if the client is going through the motions of trying to attack/mine but then decides not to (when it eventually hits your mixin).
IMO it'd make more sense if absolutely nothing happens when left-clicking, unless "Allow Interaction" is enabled.
Perhaps a MinecraftClientMixin should inject into doAttack, doItemUse, doItemPick, and handleBlockBreaking and return early if ModConfig.allowInteract is false. Since these are the methods run by MinecraftClient.handleInputEvents and therefore are the earliest opportunity to cancel any attempted interaction, short of injecting directly somewhere into handleInputEvents itself.
When "Allow Interaction" is disabled, you can still attempt to interact. E.g. when left-clicking, a use hand animation will play as if the client is going through the motions of trying to attack/mine but then decides not to (when it eventually hits your mixin).
https://user-images.githubusercontent.com/5046562/167724703-0992da00-6cde-4791-b1be-2c0485579919.mov
IMO it'd make more sense if absolutely nothing happens when left-clicking, unless "Allow Interaction" is enabled.
Perhaps a
MinecraftClientMixin
should inject intodoAttack
,doItemUse
,doItemPick
, andhandleBlockBreaking
and return early ifModConfig.allowInteract
is false. Since these are the methods run byMinecraftClient.handleInputEvents
and therefore are the earliest opportunity to cancel any attempted interaction, short of injecting directly somewhere intohandleInputEvents
itself.