Class PlayerSnapshot
java.lang.Object
com.github.happyuky7.swi.api.data.PlayerSnapshot
Saved data of one player in one
GroupContext. Immutable: data() returns a copy.
Well-known keys shared by every platform (absent when that section is disabled):
gamemode(SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR)allow_flight,flying,fly_speedexp(progress 0..1),exp-levelhunger,health,max-healthinventory.<slot>,armor_contents.<helmet|chestplate|leggings|boots>,off_hand_item,ender-chest.<slot>(item format depends onformat())potion_effect.<n>.type|duration|amplifiercustom.<sectionId>...for sections registered through the API
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlayerSnapshot(@NotNull UUID uuid, @Nullable String playerName, @NotNull GroupContext context, @NotNull DataNode data) -
Method Summary
Modifier and TypeMethodDescription@NotNull GroupContextcontext()@Nullable DataNodecustomSection(@NotNull String sectionId) @NotNull DataNodedata()int@Nullable Floatexp()@Nullable IntegerexpLevel()@NotNull Stringformat()@Nullable Stringgamemode()@Nullable Doublehealth()@Nullable Integerhunger()@Nullable String@NotNull UUIDuuid()
-
Field Details
-
FORMAT_BUKKIT
Items serialized by Bukkit's ConfigurationSerializable (plugin, historical format).- See Also:
-
FORMAT_SNBT
Items serialized as SNBT strings by the Fabric mod.- See Also:
-
-
Constructor Details
-
PlayerSnapshot
public PlayerSnapshot(@NotNull @NotNull UUID uuid, @Nullable @Nullable String playerName, @NotNull @NotNull GroupContext context, @NotNull @NotNull DataNode data)
-
-
Method Details
-
uuid
-
playerName
-
context
-
data
- Returns:
- a mutable copy of all saved values
-
format
- Returns:
FORMAT_BUKKITorFORMAT_SNBT
-
dataVersion
public int dataVersion()- Returns:
- Minecraft data version the items were saved with, or -1 when unknown
-
gamemode
-
expLevel
-
exp
-
health
-
hunger
-
customSection
- Returns:
- the data a custom
DataSectionstored, or null
-