Hello, I'm making a mod with forge 1.16.3.
I want to get screenshot path and read it and change to base64-string.
@SubscribeEvent
public void onScreenShot(ScreenshotEvent event) throws IOException {
byte[] data = Files.readAllBytes(event.getScreenshotFile().toPath());
String base64str = Base64.getEncoder().encodeToString(data);
LOGGER.info(base64str);
}
But it throw java.nio.file.NoSuchFileException: [Screenshotfile.png]
and crashed.
ScreenShotEvent fired normally so I think that screen shot file is not created yet when event fires but I don't know how should I fix.
Could you help me, please?