Class PlayerEvent.SaveToFile
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.player.PlayerEvent
net.neoforged.neoforge.event.entity.player.PlayerEvent.SaveToFile
- Enclosing class:
PlayerEvent
The player is being saved to the world store. Note that the
player may be in the process of logging out or otherwise departing
from the world. Don't assume it's association with the world.
This allows mods to load an additional file from the players directory
containing additional mod related player data.
Use this event to save the additional mod related player data to the world.
WARNING: Do not overwrite the player's .dat file here. You will corrupt the world state.
Use this event to save the additional mod related player data to the world.
WARNING: Do not overwrite the player's .dat file here. You will corrupt the world state.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.player.PlayerEvent
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerChangeGameModeEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.TabListNameFormat
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe directory where player data is being stored.getPlayerFile
(String suffix) Construct and return a recommended file for the supplied suffixThe UUID is the standard for player related file storage.Methods inherited from class net.neoforged.neoforge.event.entity.player.PlayerEvent
getEntity
-
Field Details
-
playerDirectory
-
playerUUID
-
-
Constructor Details
-
SaveToFile
-
-
Method Details
-
getPlayerFile
Construct and return a recommended file for the supplied suffix- Parameters:
suffix
- The suffix to use.
-
getPlayerDirectory
The directory where player data is being stored. Use this to locate your mod additional file. -
getPlayerUUID
The UUID is the standard for player related file storage. It is broken out here for convenience for quick file generation.
-