Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 543 Bytes

inject.md

File metadata and controls

29 lines (21 loc) · 543 Bytes

@Inject

<- Return

Injects code into the target method.

Parameters, in order:

  • All target method parameters
  • CallbackInfo (for void return type on target) or CallbackInfoReturnable<R>

Return type: void

Example mixin:

@Inject(method = "target()V", at = @At(value = "INVOKE", target = "Lnet/example/Dummy;dummy()V"))
private void mixin(CallbackInfo ci) {
    injectedCode();
}

Method modification:

  public void target() {
+     injectedCode();
      Dummy.getInstance().dummy();
  }