====== Playground ======
Possible addition to [[tutorial:mixin_examples|Mixin Examples]]
[[http://example.com|External Link]]
===== Modifying a static block =====
static {
int i = 4;
}
{{
https://dokuwiki-image-link.cph101.repl.co/test.svg
}}
public class ExampleMod implements ModInitializer {
[...]
@Override
public void onInitialize() {
AttackBlockCallback.EVENT.register((player, world, hand, pos, direction) -> {
class_2680 state = world.method_8320(pos);
/* Manual spectator check is necessary because AttackBlockCallbacks
fire before the spectator check */
if (state.method_29291() && !player.method_7325() &&
player.method_6047().method_7960()) {
player.method_5643(player.method_48923().method_48830(), 1.0F);
}
return class_1269.field_5811;
});
}
}
[[ns:page|{{:info.png}}]]