Home Commands Examples Getting Started With Scripts Global Keywords 1.21 Migration Guide
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

NetworkContext

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import vanilla/api/network/NetworkContext;

Description

Context that is provided when data is received from the network.

Members

Getter
The id of the network request.
script.zs
// CTNetworkContext.id as string
context.id

Return Type: string

Getter
The player that received the network request, this is usually the client player.
script.zs
// CTNetworkContext.player as Player
context.player

Return Type: Player