public class EnhancedVisualEventHandler {
static Minecraft mc = Minecraft.getInstance();
@SubscribeEvent
public static void onExplosionEffect(VisualExplosionEvent event) {
if (!event.isCanceled() && mc != null){
Player player = mc.player;
if (player != null && CuriosApi.getCuriosInventory(player).resolve()
.flatMap(curios -> curios.findFirstCurio(stack -> stack.getItem() instanceof ShieldofHonorItem))
.isPresent()) {
System.out.println("Visual Explosion Event Cancelled");
event.setCanceled(true);
}
}
}
@SubscribeEvent
public static void onSplashEffect(SplashEvent event) {
if (!event.isCanceled() && mc != null){
Player player = mc.player;
if (player != null && CuriosApi.getCuriosInventory(player).resolve()
.flatMap(curios -> curios.findFirstCurio(stack -> stack.getItem() instanceof ShieldofHonorItem))
.isPresent()) {
System.out.println("Splash Event Cancelled");
event.setCanceled(true);
}
}
}
@SubscribeEvent
public static void onEndermanEffect(SelectEndermanEvent event) {
if (!event.isCanceled() && mc != null){
Player player = mc.player;
if (player != null && CuriosApi.getCuriosInventory(player).resolve()
.flatMap(curios -> curios.findFirstCurio(stack -> stack.getItem() instanceof EnderQueensCrownItem))
.isPresent()) {
event.setCanceled(true);
}
}
}
}
the code above works only on Enderman, but not on explosions, i thought it was splash but it doesnt trigger either
so creepers exploding nearby you still trigger the blurring effect regardless of this because the events are not fired, never got anything to print
but enderman did effectively remove the effect.
please check since as far as i have seen, you seem to forgot to fire those events on your side
the code above works only on Enderman, but not on explosions, i thought it was splash but it doesnt trigger either
so creepers exploding nearby you still trigger the blurring effect regardless of this because the events are not fired, never got anything to print
but enderman did effectively remove the effect.
please check since as far as i have seen, you seem to forgot to fire those events on your side