Package net.minecraftforge.client.event
Class ScreenshotEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.ScreenshotEvent
public class ScreenshotEvent
extends net.minecraftforge.eventbus.api.Event
Fired when a screenshot is taken, but before it is written to disk.
 
This event is cancellable, and does not have a result. If this event is cancelled, then the screenshot is not written to disk, and the message in the event will be posted to the player's chat.
This event is fired on the main Forge event bus, only on the logical client.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Componentprivate final NativeImageprivate Componentprivate File
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the cancellation message to be used in informing the player.getImage()Returns the in-memory image of the screenshot.Returns the custom cancellation message, ornullif no custom message is set.voidsetResultMessage(Component resultMessage) Sets the new custom cancellation message used to inform the player.voidsetScreenshotFile(File screenshotFile) Sets the new file where the screenshot will be saved to.Methods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
DEFAULT_CANCEL_REASON
- 
image
- 
screenshotFile
- 
resultMessage
 
- 
- 
Constructor Details- 
ScreenshotEvent
 
- 
- 
Method Details- 
getImageReturns the in-memory image of the screenshot.- Returns:
- the in-memory image of the screenshot
 
- 
getScreenshotFile- Returns:
- the file where the screenshot will be saved to
 
- 
setScreenshotFileSets the new file where the screenshot will be saved to.- Parameters:
- screenshotFile- the new filepath
 
- 
getResultMessageReturns the custom cancellation message, ornullif no custom message is set.- Returns:
- the custom cancellation message, or nullif no custom message is set
 
- 
setResultMessageSets the new custom cancellation message used to inform the player. It may benull, in which case the default cancel reason will be used.- Parameters:
- resultMessage- the new result message
 
- 
getCancelMessageReturns the cancellation message to be used in informing the player.If there is no custom message given ( getResultMessage()returnsnull), then the message will be the default cancel reason message.- Returns:
- the cancel message for the player
 
 
-