Interface CustomPacket
- All Superinterfaces:
DataSerializable
The interface is used to send a custom data packet to a player
for further processing of this data on his client by some mod.
for further processing of this data on his client by some mod.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomPacket
Creating your data package.static CustomPacket
Creating your data package.static CustomPacket
of
(ResourceKey resourceLocation, com.google.gson.JsonElement data) Creating your data package.static CustomPacket
of
(ResourceKey resourceLocation, String data) Creating your data package.void
sendTo
(ServerPlayer player) Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Method Details
-
of
Creating your data package.- Parameters:
resourceLocation
- - Packet ID. Usually has the form modid:chanel.data
- - Package data provided as aString
-
of
Creating your data package. You can useJsonParser.parseString(java.lang.String)
to reverse the conversion on the client.- Parameters:
resourceLocation
- - Packet ID. Usually has the form modid:chanel.data
- - Package data provided as aJsonElement
.
-
of
Creating your data package.- Parameters:
resourceLocation
- - Packet ID. Usually has the form modid:chanel.data
- - Package data provided as aString
-
of
Creating your data package. You can useJsonParser.parseString(java.lang.String)
to reverse the conversion on the client.- Parameters:
resourceLocation
- - Packet ID. Usually has the form modid:chanel.data
- - Package data provided as aJsonElement
.
-
sendTo
-